X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0d3a9ed9cb47ce3b89ea9eaffbb589f9a9ff6d22..df283287e69c7941e111072ec4a4ea83e48b76f6:/db/migrate/20120318201948_create_redactions.rb?ds=sidebyside diff --git a/db/migrate/20120318201948_create_redactions.rb b/db/migrate/20120318201948_create_redactions.rb index b6ee96037..15cc1e13b 100644 --- a/db/migrate/20120318201948_create_redactions.rb +++ b/db/migrate/20120318201948_create_redactions.rb @@ -1,7 +1,7 @@ require 'migrate' class CreateRedactions < ActiveRecord::Migration - def up + def change create_table :redactions do |t| t.string :title t.text :description @@ -11,16 +11,7 @@ class CreateRedactions < ActiveRecord::Migration [:nodes, :ways, :relations].each do |tbl| add_column tbl, :redaction_id, :integer, :null => true - add_foreign_key tbl, [:redaction_id], :redactions, [:id] + add_foreign_key tbl, :redactions, :name => "#{tbl}_redaction_id_fkey" end end - - def down - [:nodes, :ways, :relations].each do |tbl| - remove_foreign_key tbl, [:redaction_id], :redactions, [:id] - remove_column tbl, :redaction_id - end - - drop_table :redactions - end end