aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db/migrate/20170307155042_set_updated_at.rb14
-rw-r--r--db/schema.rb2
2 files changed, 15 insertions, 1 deletions
diff --git a/db/migrate/20170307155042_set_updated_at.rb b/db/migrate/20170307155042_set_updated_at.rb
new file mode 100644
index 000000000..84ffd8211
--- /dev/null
+++ b/db/migrate/20170307155042_set_updated_at.rb
@@ -0,0 +1,14 @@
+class SetUpdatedAt < ActiveRecord::Migration
+ def up
+ models = %w(VehicleJourney Timeband TimeTable StopPoint StopArea RoutingConstraintZone Route RouteSection PtLink Network Line
+ JourneyPattern GroupOfLine ConnectionLink Company AccessPoint AccessLink)
+
+ models.each do |table|
+ "Chouette::#{table}".constantize.where(updated_at: nil).update_all('updated_at = created_at')
+ end
+
+ end
+
+ def down
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 6ee6bb4ea..28db2ce89 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: 20170301170956) do
+ActiveRecord::Schema.define(version: 20170307155042) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"