Sha256: 1a04f2580fa062604c27d008a69677c6e6012f9db9763119e77e1277304ac567

Contents?: true

Size: 1.05 KB

Versions: 94

Compression:

Stored size: 1.05 KB

Contents

class CreateMartyEvents < ActiveRecord::Migration[4.2]
  def change(*args)
    # Giant hack to monkey patch connection so that we can create an
    # UNLOGGED table in PostgreSQL.
    class << @connection
      alias_method :old_execute, :execute
      define_method(:execute) { |sql, name=nil|
        old_execute(sql.sub('CREATE', 'CREATE UNLOGGED'), name)
      }
    end
    create_table :marty_events do |t|
      t.integer  :promise_id, null: true
      t.string   :klass, null: false, limit: 255
      t.integer  :subject_id, null: false
      t.pg_enum  :enum_event_operation, null: false
      t.datetime :start_dt, null: true
      t.datetime :end_dt, null: true
      t.integer  :expire_secs, null: true
      t.string   :comment, null: true
    end
    class << @connection
      alias_method :execute, :old_execute
    end
    add_index :marty_events, [:klass, :subject_id,
                             :enum_event_operation],
              name: 'idx_klass_id_op'
    add_index :marty_events, [:klass, :subject_id],
              name: 'idx_klass_id'
  end
end

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
marty-14.3.0 db/migrate/201_create_marty_events.rb
marty-14.0.0 db/migrate/201_create_marty_events.rb
marty-13.0.2 db/migrate/201_create_marty_events.rb
marty-11.0.0 db/migrate/201_create_marty_events.rb
marty-10.0.3 db/migrate/201_create_marty_events.rb
marty-10.0.2 db/migrate/201_create_marty_events.rb
marty-10.0.0 db/migrate/201_create_marty_events.rb
marty-9.5.1 db/migrate/201_create_marty_events.rb
marty-9.5.0 db/migrate/201_create_marty_events.rb
marty-9.3.3 db/migrate/201_create_marty_events.rb
marty-9.3.2 db/migrate/201_create_marty_events.rb
marty-9.3.0 db/migrate/201_create_marty_events.rb
marty-8.5.0 db/migrate/201_create_marty_events.rb
marty-8.4.1 db/migrate/201_create_marty_events.rb
marty-8.3.1 db/migrate/201_create_marty_events.rb
marty-8.2.0 db/migrate/201_create_marty_events.rb
marty-8.0.0 db/migrate/201_create_marty_events.rb
marty-6.1.0 db/migrate/201_create_marty_events.rb
marty-5.2.0 db/migrate/201_create_marty_events.rb
marty-5.1.4 db/migrate/201_create_marty_events.rb