mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
15 lines
339 B
Ruby
15 lines
339 B
Ruby
class MoveToManyToMany < ActiveRecord::Migration[5.1]
|
|
def self.up
|
|
remove_column :photos, :category_id
|
|
create_table :categories_photos, id: false do |t|
|
|
t.integer :category_id
|
|
t.integer :photo_id
|
|
end
|
|
end
|
|
|
|
def self.down
|
|
add_column :photos, :category_id, :integer
|
|
drop_table :categories_photos
|
|
end
|
|
end
|