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