streama
streama copied to clipboard
Unable to delete entry on database h2
On the dbconsole i am trying to delete the first id from the table "file" but i keep getting this error :
DELETE FROM FILE WHERE ID = 1; Referential integrity constraint violation: "FKOWVKXE9NMIWXUM3FIOLSLCF6C: PUBLIC.VIDEO_FILE FOREIGN KEY(FILE_ID) REFERENCES PUBLIC.FILE(ID) (1)"; SQL statement:
Using streama web interface also gives an error , any chance to fix this or what am i missing ?
There is a row in the table VIDEO_FILE that is a child row for this row you are trying to delete.
You need to delete firstly the child row like this:
DELETE FROM VIDEO_FILE WHERE FILE_ID = 1;
and after probably you will be able to run:
DELETE FROM FILE WHERE ID = 1;
I didn't see if there are any other related tables. If it exists you will have to do the same in the other tables.
thank you