Sha256: 42b40763348ea1127a6c88c346610cdf166b54dafd211a845d90c8a02cfddc86

Contents?: true

Size: 940 Bytes

Versions: 80

Compression:

Stored size: 940 Bytes

Contents

class CreateMartyPromises < ActiveRecord::Migration
  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

80 entries across 80 versions & 1 rubygems

Version Path
marty-1.2.9 db/migrate/091_create_marty_promises.rb
marty-1.2.8 db/migrate/091_create_marty_promises.rb
marty-1.2.7 db/migrate/091_create_marty_promises.rb
marty-1.2.6 db/migrate/091_create_marty_promises.rb
marty-1.2.5 db/migrate/091_create_marty_promises.rb
marty-1.2.4 db/migrate/091_create_marty_promises.rb
marty-1.2.3 db/migrate/091_create_marty_promises.rb
marty-1.2.2 db/migrate/091_create_marty_promises.rb
marty-1.2.1 db/migrate/091_create_marty_promises.rb
marty-1.2.0 db/migrate/091_create_marty_promises.rb
marty-1.1.9 db/migrate/091_create_marty_promises.rb
marty-1.1.8 db/migrate/091_create_marty_promises.rb
marty-1.1.7 db/migrate/091_create_marty_promises.rb
marty-1.1.6 db/migrate/091_create_marty_promises.rb
marty-1.1.5 db/migrate/091_create_marty_promises.rb
marty-1.1.4 db/migrate/091_create_marty_promises.rb
marty-1.1.3 db/migrate/091_create_marty_promises.rb
marty-1.1.2 db/migrate/091_create_marty_promises.rb
marty-1.1.1 db/migrate/091_create_marty_promises.rb
marty-1.0.54 db/migrate/091_create_marty_promises.rb