0
votes

Hope, it's my last question about October CMS :)

I need to add some columns to the existing table called "foo_bar_experts". But when i'm saving my migration file there is an error popping

SQLSTATE[42701]: Duplicate column: 7 ERROR: column "event_id" of relation "agm_dalshe_events_skills" already exists (SQL: alter table "agm_dalshe_events_skills" add column "event_id" integer not null, add column "skill_id" integer not null)

I tried to delete this table, create new but this error haunting me, and I can't actually do nothing in my database.

Can you suggest any ideas what the hell is happening there? Thanks in advance.

1
its because your migration files are generated differently and may be you changed table by your self so created conflict. first migration file add event_id then again it trying to add once again event_id - Hardik Satasiya
so suggestion go to > updates folder check each file and delete the line where it is adding event_id first one [across multiple files] so there is only code which can add single time event_id. do it smartly so at last you have both fields[event_id , skill_id] only once, then just uninstall plugin delete all tables from db related to plugin [if you have data export it]. now again install plugin then import your data again may be that will solve your problem. - Hardik Satasiya
nice to hear, you solved your problem :) - Hardik Satasiya

1 Answers

0
votes

Solution go to > updates folder of your plugin.

check each file and delete the line where it is adding event_id first time [across multiple files] so there should only code remain in which it add single time event_id.

do it smartly so at last you have both fields[event_id , skill_id] only once,

Then just uninstall plugin delete all tables from db related to plugin [if you have data export it]. now again install plugin then import your data again may be that will solve your problem.

if any doubt please comment.