]> git.openstreetmap.org Git - rails.git/commitdiff
Add yet more foreign keys.
authorTom Hughes <tom@compton.nu>
Fri, 8 May 2009 00:03:40 +0000 (00:03 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 8 May 2009 00:03:40 +0000 (00:03 +0000)
db/migrate/030_add_foreign_keys.rb [new file with mode: 0644]

diff --git a/db/migrate/030_add_foreign_keys.rb b/db/migrate/030_add_foreign_keys.rb
new file mode 100644 (file)
index 0000000..183aa30
--- /dev/null
@@ -0,0 +1,12 @@
+class AddForeignKeys < ActiveRecord::Migration
+  def self.up
+    add_foreign_key :changeset_tags, [:id], :changesets
+    add_foreign_key :diary_comments, [:diary_entry_id], :diary_entries, [:id]
+    add_foreign_key :gps_points, [:gpx_id], :gpx_files, [:id]
+    add_foreign_key :gpx_file_tags, [:gpx_id], :gpx_files, [:id]
+  end
+
+  def self.down
+    raise IrreversibleMigration.new
+  end
+end