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-5.1.3 db/migrate/201_create_marty_events.rb
marty-5.1.2 db/migrate/201_create_marty_events.rb
marty-5.1.1 db/migrate/201_create_marty_events.rb
marty-5.1.0 db/migrate/201_create_marty_events.rb
marty-3.1.0 db/migrate/201_create_marty_events.rb
marty-3.0.1 db/migrate/201_create_marty_events.rb
marty-4.0.0.rc2 db/migrate/201_create_marty_events.rb
marty-3.0.0 db/migrate/201_create_marty_events.rb
marty-2.9.3 db/migrate/201_create_marty_events.rb
marty-2.9.2 db/migrate/201_create_marty_events.rb
marty-2.9.1 db/migrate/201_create_marty_events.rb
marty-2.8.0 db/migrate/201_create_marty_events.rb
marty-2.7.3 db/migrate/201_create_marty_events.rb
marty-2.7.2 db/migrate/201_create_marty_events.rb
marty-2.7.1 db/migrate/201_create_marty_events.rb
marty-2.7.0 db/migrate/201_create_marty_events.rb
marty-2.6.8 db/migrate/201_create_marty_events.rb
marty-2.6.7 db/migrate/201_create_marty_events.rb
marty-2.6.6 db/migrate/201_create_marty_events.rb
marty-2.6.5 db/migrate/201_create_marty_events.rb