Sha256: 309d456a911ace7ba8271e62fd6e41c4c54cf10fa8b071643a242bf98ee9fe0f

Contents?: true

Size: 945 Bytes

Versions: 94

Compression:

Stored size: 945 Bytes

Contents

class CreateMartyPromises < ActiveRecord::Migration[4.2]
  include Marty::Migrations

  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_promises do |t|
      t.string     :title,   null: false, limit: 255
      t.references :user
      t.string     :cformat, limit: 255
      t.references :parent
      t.references :job
      t.boolean    :status
      t.binary     :result
      t.datetime   :start_dt
      t.datetime   :end_dt
    end

    class << @connection
      alias_method :execute, :old_execute
    end

    add_index :marty_promises, :parent_id
    add_fk :promises, :promises, column: 'parent_id'
    add_fk :promises, :users
  end
end

Version data entries

94 entries across 94 versions & 1 rubygems

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