diff options
author | Christopher Baines <mail@cbaines.net> | 2021-05-27 23:49:56 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-05-27 23:49:56 +0100 |
commit | 94c634a7878c0a82503f272a497e09bfe465aca3 (patch) | |
tree | 449295d9ca4d45fd231acee74328da0093680913 /sqitch | |
parent | 27fc5328a8b81e50333ee235d0c8b07946032903 (diff) | |
download | build-coordinator-94c634a7878c0a82503f272a497e09bfe465aca3.tar build-coordinator-94c634a7878c0a82503f272a497e09bfe465aca3.tar.gz |
Fix part of the create_outputs migration
It was completely broken, since it would just delete all entries from the
unbuilt outputs table.
Diffstat (limited to 'sqitch')
-rw-r--r-- | sqitch/sqlite/deploy/create_outputs.sql | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sqitch/sqlite/deploy/create_outputs.sql b/sqitch/sqlite/deploy/create_outputs.sql index 03f0b42..082e1ab 100644 --- a/sqitch/sqlite/deploy/create_outputs.sql +++ b/sqitch/sqlite/deploy/create_outputs.sql @@ -42,12 +42,11 @@ CREATE TABLE unbuilt_outputs_new ( output_id INTEGER PRIMARY KEY REFERENCES outputs (id) ); -UPDATE unbuilt_outputs_new SET output_id = ( - SELECT id +INSERT INTO unbuilt_outputs_new + SELECT outputs.id FROM unbuilt_outputs INNER JOIN outputs - ON unbuilt_outputs.output = outputs.output -); + ON unbuilt_outputs.output = outputs.output; DROP TABLE unbuilt_outputs; ALTER TABLE unbuilt_outputs_new RENAME TO unbuilt_outputs; |