1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00
danbarberphoto/db/migrate/20101008172319_move_to_many_to_many.rb
2021-07-16 12:58:13 -05:00

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