Make sure to delete all the realisation refs

Deleting just one will only work in the test cases where I didn’t bother
creating too many of them :p
This commit is contained in:
regnat 2021-11-05 11:17:22 +01:00 committed by Théophane Hufschmitt
parent 74d6782a6a
commit 86d7a11c6b
2 changed files with 2 additions and 2 deletions

View file

@ -21,7 +21,7 @@ create index if not exists IndexRealisations on Realisations(drvPath, outputName
-- realisations -- realisations
create trigger if not exists DeleteSelfRefsViaRealisations before delete on ValidPaths create trigger if not exists DeleteSelfRefsViaRealisations before delete on ValidPaths
begin begin
delete from RealisationsRefs where realisationReference = ( delete from RealisationsRefs where realisationReference in (
select id from Realisations where outputPath = old.id select id from Realisations where outputPath = old.id
); );
end; end;

View file

@ -148,7 +148,7 @@ void migrateCASchema(SQLite& db, Path schemaPath, AutoCloseFD& lockFd)
db.exec(R"( db.exec(R"(
create trigger if not exists DeleteSelfRefsViaRealisations before delete on ValidPaths create trigger if not exists DeleteSelfRefsViaRealisations before delete on ValidPaths
begin begin
delete from RealisationsRefs where realisationReference = ( delete from RealisationsRefs where realisationReference in (
select id from Realisations where outputPath = old.id select id from Realisations where outputPath = old.id
); );
end; end;