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