aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-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
+