diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/006_version_public_body.rb | 9 | ||||
-rw-r--r-- | db/schema.rb | 13 |
2 files changed, 21 insertions, 1 deletions
diff --git a/db/migrate/006_version_public_body.rb b/db/migrate/006_version_public_body.rb new file mode 100644 index 000000000..34586add2 --- /dev/null +++ b/db/migrate/006_version_public_body.rb @@ -0,0 +1,9 @@ +class VersionPublicBody < ActiveRecord::Migration + def self.up + PublicBody.create_versioned_table + end + + def self.down + PublicBody.drop_versioned_table + end +end diff --git a/db/schema.rb b/db/schema.rb index eaabdc961..46802bf9a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,7 +2,7 @@ # migrations feature of ActiveRecord to incrementally modify your database, and # then regenerate this schema definition. -ActiveRecord::Schema.define(:version => 5) do +ActiveRecord::Schema.define(:version => 6) do create_table "info_requests", :force => true do |t| t.column "title", :text @@ -14,6 +14,17 @@ ActiveRecord::Schema.define(:version => 5) do t.column "short_name", :text t.column "request_email", :text t.column "complaint_email", :text + t.column "version", :integer + end + + create_table "public_body_versions", :force => true do |t| + t.column "public_body_id", :integer + t.column "version", :integer + t.column "name", :text + t.column "short_name", :text + t.column "request_email", :text + t.column "complaint_email", :text + t.column "updated_at", :datetime end create_table "sessions", :force => true do |t| |