maybe do this through a migration?
This commit is contained in:
parent
b78486ce1e
commit
5d493b154c
1 changed files with 12 additions and 0 deletions
12
db/migrate/8_add_primary_key_to_categorizations.rb
Normal file
12
db/migrate/8_add_primary_key_to_categorizations.rb
Normal file
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue