for real?

This commit is contained in:
benji 2017-01-16 23:19:13 +01:00
parent c4569551d9
commit 99c5a8b266

View file

@ -1,5 +1,6 @@
class CreateRequests < ActiveRecord::Migration
def change
unless table_exists? :requests
create_table :requests do |t|
t.references :debtor, null: false
t.references :creditor, null: false
@ -11,6 +12,7 @@ class CreateRequests < ActiveRecord::Migration
t.timestamps null: false
end
end
add_index :requests, :debtor_id unless index_exists?(:requests, :debtor)
add_index :requests, :creditor_id unless index_exists?(:requests, :creditor)