]> git.openstreetmap.org Git - rails.git/blob - db/migrate/20120318201948_create_redactions.rb
Merge remote-tracking branch 'upstream/pull/4705'
[rails.git] / db / migrate / 20120318201948_create_redactions.rb
1 class CreateRedactions < ActiveRecord::Migration[4.2]
2   def change
3     create_table :redactions do |t|
4       t.string :title
5       t.text :description
6
7       t.timestamps :null => true
8     end
9
10     [:nodes, :ways, :relations].each do |tbl|
11       add_column tbl, :redaction_id, :integer, :null => true
12       add_foreign_key tbl, :redactions, :name => "#{tbl}_redaction_id_fkey"
13     end
14   end
15 end