aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorlizconlan <liz@mysociety.org>2014-08-04 18:48:04 +0100
committerLouise Crow <louise.crow@gmail.com>2014-09-22 12:39:03 +0100
commit7df6456d69d71e6dba34fbc0d7b3d262d2dc0d38 (patch)
tree96b34f9e7fbcd7be5fcf0ef0042b10b1b58e222f /db
parent31c1f47a6bca88b2be9fb463721fb26698e79f82 (diff)
Add display order to public body categories and headings
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20140804120601_add_display_order_to_categories_and_headings.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20140804120601_add_display_order_to_categories_and_headings.rb b/db/migrate/20140804120601_add_display_order_to_categories_and_headings.rb
new file mode 100644
index 000000000..60ac5ec5e
--- /dev/null
+++ b/db/migrate/20140804120601_add_display_order_to_categories_and_headings.rb
@@ -0,0 +1,16 @@
+class AddDisplayOrderToCategoriesAndHeadings < ActiveRecord::Migration
+ def up
+ add_column :public_body_categories_public_body_headings, :category_display_order, :integer
+
+ rename_table :public_body_categories_public_body_headings, :public_body_category_links
+ add_column :public_body_category_links, :id, :primary_key
+ add_index :public_body_category_links, [:public_body_category_id, :public_body_heading_id], :name => "index_public_body_category_links_on_join_ids", :primary => true
+ end
+
+ def down
+ remove_index :public_body_category_links, :name => "index_public_body_category_links_on_join_ids"
+ remove_column :public_body_category_links, :category_display_order
+ remove_column :public_body_category_links, :id
+ rename_table :public_body_category_links, :public_body_categories_public_body_headings
+ end
+end