diff options
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20160909092812_create_stop_area_referential_syncs.rb | 9 | ||||
| -rw-r--r-- | db/migrate/20160909093322_create_stop_area_sync_operations.rb | 12 | ||||
| -rw-r--r-- | db/schema.rb | 20 | ||||
| -rw-r--r-- | db/seeds.rb | 2 |
4 files changed, 41 insertions, 2 deletions
diff --git a/db/migrate/20160909092812_create_stop_area_referential_syncs.rb b/db/migrate/20160909092812_create_stop_area_referential_syncs.rb new file mode 100644 index 000000000..eb68f662b --- /dev/null +++ b/db/migrate/20160909092812_create_stop_area_referential_syncs.rb @@ -0,0 +1,9 @@ +class CreateStopAreaReferentialSyncs < ActiveRecord::Migration + def change + create_table :stop_area_referential_syncs do |t| + t.references :stop_area_referential, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20160909093322_create_stop_area_sync_operations.rb b/db/migrate/20160909093322_create_stop_area_sync_operations.rb new file mode 100644 index 000000000..fef4f5e1f --- /dev/null +++ b/db/migrate/20160909093322_create_stop_area_sync_operations.rb @@ -0,0 +1,12 @@ +class CreateStopAreaSyncOperations < ActiveRecord::Migration + def change + create_table :stop_area_sync_operations do |t| + t.string :status + t.references :stop_area_referential_sync + t.string :message + + t.timestamps + end + add_index :stop_area_sync_operations, :stop_area_referential_sync_id, name: 'stop_area_referential_sync_id' + end +end diff --git a/db/schema.rb b/db/schema.rb index a5b18db68..0db23d55f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160905094930) do +ActiveRecord::Schema.define(version: 20160909093322) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -449,12 +449,30 @@ ActiveRecord::Schema.define(version: 20160905094930) do t.boolean "owner" end + create_table "stop_area_referential_syncs", force: true do |t| + t.integer "stop_area_referential_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "stop_area_referential_syncs", ["stop_area_referential_id"], :name => "index_stop_area_referential_syncs_on_stop_area_referential_id" + create_table "stop_area_referentials", force: true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end + create_table "stop_area_sync_operations", force: true do |t| + t.string "status" + t.integer "stop_area_referential_sync_id" + t.string "message" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "stop_area_sync_operations", ["stop_area_referential_sync_id"], :name => "stop_area_referential_sync_id" + create_table "stop_areas", force: true do |t| t.integer "parent_id", limit: 8 t.string "objectid", null: false diff --git a/db/seeds.rb b/db/seeds.rb index a975b07f8..14640e608 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -42,6 +42,7 @@ line_referential = LineReferential.find_or_create_by(name: "CodifLigne") do |ref end LineReferentialSync.find_or_create_by(line_referential: line_referential) +StopAreaReferentialSync.find_or_create_by(stop_area_referential: stop_area_referential) 10.times do |n| line_referential.lines.find_or_create_by name: "Test #{n}" do |l| @@ -50,7 +51,6 @@ LineReferentialSync.find_or_create_by(line_referential: line_referential) end - offer_workbench = OfferWorkbench.find_or_create_by(name: "Gestion de l'offre", organisation: operator) [["parissudest201604", "Paris Sud-Est Avril 2016"], |
