diff options
| author | Xinhui | 2017-03-16 16:03:08 +0100 |
|---|---|---|
| committer | Xinhui | 2017-03-16 16:08:51 +0100 |
| commit | 699c5d97f767c052fc78f7f8c694fa3d4721c580 (patch) | |
| tree | 2776d5e4877c34d67fed1a45cbdc57ab6ff5fdd9 | |
| parent | cd148f8a61ea468dbf241e6235987de0ee9457e6 (diff) | |
| download | chouette-core-699c5d97f767c052fc78f7f8c694fa3d4721c580.tar.bz2 | |
Fix Multiple migrations have the name CreateImports
| -rw-r--r-- | db/migrate/20120515134710_create_imports.rb | 12 | ||||
| -rw-r--r-- | db/migrate/20161227104202_create_new_imports.rb (renamed from db/migrate/20161227104202_create_imports.rb) | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/db/migrate/20120515134710_create_imports.rb b/db/migrate/20120515134710_create_imports.rb index 5da398fc9..5bc5b367b 100644 --- a/db/migrate/20120515134710_create_imports.rb +++ b/db/migrate/20120515134710_create_imports.rb @@ -1,11 +1,13 @@ class CreateImports < ActiveRecord::Migration def change - create_table :imports do |t| - t.belongs_to :referential - t.string :status + unless table_exists? :imports + create_table :imports do |t| + t.belongs_to :referential + t.string :status - t.timestamps + t.timestamps + end + add_index :imports, :referential_id end - add_index :imports, :referential_id end end diff --git a/db/migrate/20161227104202_create_imports.rb b/db/migrate/20161227104202_create_new_imports.rb index 97a2d6029..e53f0b53d 100644 --- a/db/migrate/20161227104202_create_imports.rb +++ b/db/migrate/20161227104202_create_new_imports.rb @@ -1,4 +1,4 @@ -class CreateImports < ActiveRecord::Migration +class CreateNewImports < ActiveRecord::Migration def change create_table :imports do |t| t.string :status |
