openstreetmap-website/db/migrate/20120318201948_create_redactions.rb
2017-10-17 18:49:55 +01:00

17 lines
414 B
Ruby

require "migrate"
class CreateRedactions < ActiveRecord::Migration[5.0]
def change
create_table :redactions do |t|
t.string :title
t.text :description
t.timestamps :null => true
end
[:nodes, :ways, :relations].each do |tbl|
add_column tbl, :redaction_id, :integer, :null => true
add_foreign_key tbl, :redactions, :name => "#{tbl}_redaction_id_fkey"
end
end
end