Sha256: 1dbe6b051eb25028ed33b03886f2ec0be2aa1f6283588dd9f6b59f1647e9af36
Contents?: true
Size: 968 Bytes
Versions: 16
Compression:
Stored size: 968 Bytes
Contents
require 'marty/migrations' 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
16 entries across 16 versions & 1 rubygems