diff --git a/server/backend/migration/20240311000000.go b/server/backend/migration/20240311000000.go index fd3f46f6..45f5602d 100644 --- a/server/backend/migration/20240311000000.go +++ b/server/backend/migration/20240311000000.go @@ -13,7 +13,7 @@ func migrate20240311000000() *gormigrate.Migration { ID: "20240311000000", Migrate: func(tx *gorm.DB) error { // make sure that dish_rating is FK-bound to dish - if err := tx.Exec("alter table dish modify dish int not null primary key auto_increment").Error; err != nil { + if err := tx.Exec("alter table dish modify dish int not null auto_increment").Error; err != nil { return err } if err := tx.Exec("alter table dish_rating add constraint dish_rating_dish_dish_fk foreign key (dishID) references dish (dish) on update cascade on delete cascade").Error; err != nil { @@ -31,7 +31,7 @@ func migrate20240311000000() *gormigrate.Migration { if err := tx.Exec("alter table dish_rating drop constraint dish_rating_dish_dish_fk").Error; err != nil { return err } - if err := tx.Exec("alter table dish_rating modify dish int primary key auto_increment").Error; err != nil { + if err := tx.Exec("alter table dish modify dish int auto_increment").Error; err != nil { return err } // because dishes already have a cafeteria, storing this agiain is not nessesary