aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorJoe Sak <joe@joesak.com>2011-07-18 15:24:30 -0500
committerJoe Sak <joe@joesak.com>2011-07-18 15:24:30 -0500
commit5d493b154c97de5ba4558ced644ecf0f666df1f5 (patch)
tree6fe0c1d67aa434783866e0baaf71f866ec321c9b /db
parentb78486ce1ede4e5c384a2e0561173549925d21a1 (diff)
downloadrefinerycms-blog-5d493b154c97de5ba4558ced644ecf0f666df1f5.tar.gz
refinerycms-blog-5d493b154c97de5ba4558ced644ecf0f666df1f5.tar.bz2
refinerycms-blog-5d493b154c97de5ba4558ced644ecf0f666df1f5.zip
maybe do this through a migration?
Diffstat (limited to 'db')
-rw-r--r--db/migrate/8_add_primary_key_to_categorizations.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/8_add_primary_key_to_categorizations.rb b/db/migrate/8_add_primary_key_to_categorizations.rb
new file mode 100644
index 0000000..efee289
--- /dev/null
+++ b/db/migrate/8_add_primary_key_to_categorizations.rb
@@ -0,0 +1,12 @@
+class AddPrimaryKeyToCategorizations < ActiveRecord::Migration
+ def self.up
+ unless ::Categorization.column_names.include?("id")
+ add_column :blog_categories_blog_posts, :id, :primary_key
+ end
+ end
+
+ def self.down
+ remove_column :blog_categories_blog_posts, :id
+ end
+end
+