X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/851de28303fc9c24d095b9452b862bea618ec0da..d48b25124eaf561428176c60b79cc90e0a8e8125:/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..8a1cf6bf3 100644 --- a/db/migrate/20120318201948_create_redactions.rb +++ b/db/migrate/20120318201948_create_redactions.rb @@ -1,26 +1,17 @@ -require 'migrate' +require "migrate" class CreateRedactions < ActiveRecord::Migration - def up + 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] + 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