Skip to content

Commit 07c1e7f

Browse files
committed
fix(action): join on the derivation path, not the output path
1 parent 1b9cbef commit 07c1e7f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/templates/merge.sql

+5-8
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ drop table if exists DerivationOutputs;
8888

8989
create table DerivationOutputs
9090
(
91-
drv integer not null,
91+
drv integer not null, -- index of a path of a derivation in ValidPaths
9292
id text not null, -- symbolic output id, usually "out"
9393
path text not null,
9494
primary key (drv, id),
@@ -203,14 +203,11 @@ from DerivationOutputs1;
203203
-- Calculate updated derivation outputs for the second store
204204
-- =====
205205

206-
-- drv | id | path
206+
-- drv | id | path | drvPath
207207
drop view if exists DerivationIdPaths;
208208

209-
210-
-- TODO what is drv?
211-
212209
create view DerivationIdPaths as
213-
select drv, DerivationOutputs2.id, ValidPaths2_.path
210+
select drv, DerivationOutputs2.id, DerivationOutputs2.path, ValidPaths2_.path as drvPath
214211
from DerivationOutputs2
215212
join (select id, path from ValidPaths2) as ValidPaths2_ on ValidPaths2_.id = drv;
216213

@@ -219,9 +216,9 @@ drop view if exists DerivationOutputs2Updated;
219216

220217
create view DerivationOutputs2Updated as
221218
select ValidPaths_.drvNew as drv, id, DerivationIdPaths_.path
222-
from (select id, path from DerivationIdPaths) as DerivationIdPaths_
219+
from (select id, path, drvPath from DerivationIdPaths) as DerivationIdPaths_
223220
join (select id as drvNew, path from ValidPaths) as ValidPaths_
224-
on DerivationIdPaths_.path = ValidPaths_.path;
221+
on DerivationIdPaths_.drvPath = ValidPaths_.path;
225222

226223
-- =====
227224
-- Insert updated derivation outputs from the second store

0 commit comments

Comments
 (0)