openstreetmap-website/db/migrate/20120318201948_create_redactions.rb
Tom Hughes ac7bb003ec Cleanup migrations
Cleanup our migrations, replacing as much of our custom code
and monkey patching with modern standard rails methods.
2015-01-11 12:53:01 +00:00

17 lines
395 B
Ruby

require 'migrate'
class CreateRedactions < ActiveRecord::Migration
def change
create_table :redactions do |t|
t.string :title
t.text :description
t.timestamps
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