concrete5.8.2 Foreing Key Check

Permalink
My foreign keys need fixing:

`WorkflowProgressNotifications` in this table there are many entries up to nID 1303.
There are no entries in `Notifications`.

When our server restarted the autoincrement on the table `Notifications`.nID somehow reset to 0

This caused the site to stop being editable as there were foreign key errors on page delete publish etc..
This has been fixed by increasing the autoincrement on the empty table to 1304

I have fixed this problem on another site running a command line form the website root. This fixed the foreign key errors on the database.

php ./concrete/bin/concrete5 orm:schema-tool:update --dump-sql to fix the foreign keys.

This command is failing to rub. It returns this error

`There are no commands defined in the "orm:schema-tool" namespace.`

Please could someone give advice on how to get this command to run.

If any one knows what can cause the foreign keys on the `Notification` table to fail in the first place , please let me know as this has happed on 2 separate sites both on 8.5.2

Thank you

Stephanie

 
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
You need to post the full error message in order for us to comment.
frankdesign replied on at Permalink Reply
Here is the whole error message:

[###@server ###]$ php ./concrete/bin/concrete5 orm:schema-tool:update --dump-sql


There are no commands defined in the "orm:schema-tool" namespace.

I have fixed the foreign key errors by increasing the autoincrement on `Notifications`.nID to higher than the highest entry in the WorkflowNotifications.nID table.

I would like to fix the data in the database as when the server is restarted the autoincrement on the Notifications.nID table may go to 0 again as this table is empty.

I would also like to know if anyone else has had this problem and what they think caused it.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
I meant the foreign key errors on page delete, publish, etc.