streama icon indicating copy to clipboard operation
streama copied to clipboard

Unable to delete entry on database h2

Open peterpt opened this issue 2 years ago • 1 comments

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 ?

peterpt avatar Jun 19 '22 08:06 peterpt

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.

denisgmarques avatar Jul 22 '22 23:07 denisgmarques

thank you

peterpt avatar Sep 06 '23 12:09 peterpt