aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorXinhui2017-01-04 11:35:25 +0100
committerXinhui2017-01-04 11:35:25 +0100
commitf40d4c1940426124bb4a8464b707cd673d9d5ee6 (patch)
treeb2ed99782cd122b97b3950720b3b4f559bb34ba4 /db
parent9c08e8f9f42906f9be17a8fbce7fcd83dbd51179 (diff)
downloadchouette-core-f40d4c1940426124bb4a8464b707cd673d9d5ee6.tar.bz2
Fix attempt migration
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20161208112130_create_routing_constraint_zones.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/db/migrate/20161208112130_create_routing_constraint_zones.rb b/db/migrate/20161208112130_create_routing_constraint_zones.rb
index 0fa1ef1ae..2c1ee8248 100644
--- a/db/migrate/20161208112130_create_routing_constraint_zones.rb
+++ b/db/migrate/20161208112130_create_routing_constraint_zones.rb
@@ -1,11 +1,19 @@
class CreateRoutingConstraintZones < ActiveRecord::Migration
- def change
- create_table :routing_constraint_zones do |t|
- t.string :name
- t.integer :stop_area_ids, array: true
- t.belongs_to :line, index: true
+ def up
+ unless table_exists? :routing_constraint_zones
+ create_table :routing_constraint_zones do |t|
+ t.string :name
+ t.integer :stop_area_ids, array: true
+ t.belongs_to :line, index: true
- t.timestamps
+ t.timestamps
+ end
+ end
+ end
+
+ def down
+ if table_exists? :routing_constraint_zones
+ drop_table :routing_constraint_zones
end
end
end