diff --git a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_both_migrations.sql b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_both_migrations.sql index 15f5ec00890..354fc9a4035 100644 --- a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_both_migrations.sql +++ b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_both_migrations.sql @@ -17,9 +17,9 @@ WITH UPDATE migration SET - target_state = $2, time_target_updated = $3 + target_state = $2, time_target_updated = $3, target_gen = $4 WHERE - (migration.id = $4 AND migration.target_propolis_id = $5) AND migration.target_gen < $6 + (migration.id = $5 AND migration.target_propolis_id = $6) AND migration.target_gen < $7 RETURNING id ), @@ -40,7 +40,7 @@ WITH FROM migration WHERE - migration.id = $7 AND (migration.time_deleted IS NULL) + migration.id = $8 AND (migration.time_deleted IS NULL) ) AS id ), @@ -49,9 +49,9 @@ WITH UPDATE migration SET - source_state = $8, time_source_updated = $9 + source_state = $9, time_source_updated = $10, source_gen = $11 WHERE - (migration.id = $10 AND migration.source_propolis_id = $11) AND migration.source_gen < $12 + (migration.id = $12 AND migration.source_propolis_id = $13) AND migration.source_gen < $14 RETURNING id ), @@ -63,15 +63,15 @@ WITH migration_out_found LEFT JOIN migration_out_updated ON migration_out_found.id = migration_out_updated.id ), - vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $13) AS id), + vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $15) AS id), vmm_updated AS ( UPDATE vmm SET - time_state_updated = $14, state_generation = $15, state = $16 + time_state_updated = $16, state_generation = $17, state = $18 WHERE - ((vmm.time_deleted IS NULL) AND vmm.id = $17) AND vmm.state_generation < $18 + ((vmm.time_deleted IS NULL) AND vmm.id = $19) AND vmm.state_generation < $20 RETURNING id ), diff --git a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_migration_in.sql b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_migration_in.sql index 03f6d27d2cd..870cce4c02b 100644 --- a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_migration_in.sql +++ b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_migration_in.sql @@ -17,9 +17,9 @@ WITH UPDATE migration SET - target_state = $2, time_target_updated = $3 + target_state = $2, time_target_updated = $3, target_gen = $4 WHERE - (migration.id = $4 AND migration.target_propolis_id = $5) AND migration.target_gen < $6 + (migration.id = $5 AND migration.target_propolis_id = $6) AND migration.target_gen < $7 RETURNING id ), @@ -31,15 +31,15 @@ WITH migration_in_found LEFT JOIN migration_in_updated ON migration_in_found.id = migration_in_updated.id ), - vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $7) AS id), + vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $8) AS id), vmm_updated AS ( UPDATE vmm SET - time_state_updated = $8, state_generation = $9, state = $10 + time_state_updated = $9, state_generation = $10, state = $11 WHERE - ((vmm.time_deleted IS NULL) AND vmm.id = $11) AND vmm.state_generation < $12 + ((vmm.time_deleted IS NULL) AND vmm.id = $12) AND vmm.state_generation < $13 RETURNING id ), diff --git a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_migration_out.sql b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_migration_out.sql index 6dd4ab55205..4dea3779f7b 100644 --- a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_migration_out.sql +++ b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_and_migration_out.sql @@ -17,9 +17,9 @@ WITH UPDATE migration SET - source_state = $2, time_source_updated = $3 + source_state = $2, time_source_updated = $3, source_gen = $4 WHERE - (migration.id = $4 AND migration.source_propolis_id = $5) AND migration.source_gen < $6 + (migration.id = $5 AND migration.source_propolis_id = $6) AND migration.source_gen < $7 RETURNING id ), @@ -31,15 +31,15 @@ WITH migration_out_found LEFT JOIN migration_out_updated ON migration_out_found.id = migration_out_updated.id ), - vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $7) AS id), + vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $8) AS id), vmm_updated AS ( UPDATE vmm SET - time_state_updated = $8, state_generation = $9, state = $10 + time_state_updated = $9, state_generation = $10, state = $11 WHERE - ((vmm.time_deleted IS NULL) AND vmm.id = $11) AND vmm.state_generation < $12 + ((vmm.time_deleted IS NULL) AND vmm.id = $12) AND vmm.state_generation < $13 RETURNING id ), diff --git a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_both_migrations.sql b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_both_migrations.sql index 3959f323c92..52c28f85c37 100644 --- a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_both_migrations.sql +++ b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_both_migrations.sql @@ -41,9 +41,9 @@ WITH UPDATE migration SET - target_state = $11, time_target_updated = $12 + target_state = $11, time_target_updated = $12, target_gen = $13 WHERE - (migration.id = $13 AND migration.target_propolis_id = $14) AND migration.target_gen < $15 + (migration.id = $14 AND migration.target_propolis_id = $15) AND migration.target_gen < $16 RETURNING id ), @@ -64,7 +64,7 @@ WITH FROM migration WHERE - migration.id = $16 AND (migration.time_deleted IS NULL) + migration.id = $17 AND (migration.time_deleted IS NULL) ) AS id ), @@ -73,9 +73,9 @@ WITH UPDATE migration SET - source_state = $17, time_source_updated = $18 + source_state = $18, time_source_updated = $19, source_gen = $20 WHERE - (migration.id = $19 AND migration.source_propolis_id = $20) AND migration.source_gen < $21 + (migration.id = $21 AND migration.source_propolis_id = $22) AND migration.source_gen < $23 RETURNING id ), @@ -87,15 +87,15 @@ WITH migration_out_found LEFT JOIN migration_out_updated ON migration_out_found.id = migration_out_updated.id ), - vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $22) AS id), + vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $24) AS id), vmm_updated AS ( UPDATE vmm SET - time_state_updated = $23, state_generation = $24, state = $25 + time_state_updated = $25, state_generation = $26, state = $27 WHERE - ((vmm.time_deleted IS NULL) AND vmm.id = $26) AND vmm.state_generation < $27 + ((vmm.time_deleted IS NULL) AND vmm.id = $28) AND vmm.state_generation < $29 RETURNING id ), diff --git a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_migration_in.sql b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_migration_in.sql index ab73df18048..e717008617d 100644 --- a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_migration_in.sql +++ b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_migration_in.sql @@ -41,9 +41,9 @@ WITH UPDATE migration SET - target_state = $11, time_target_updated = $12 + target_state = $11, time_target_updated = $12, target_gen = $13 WHERE - (migration.id = $13 AND migration.target_propolis_id = $14) AND migration.target_gen < $15 + (migration.id = $14 AND migration.target_propolis_id = $15) AND migration.target_gen < $16 RETURNING id ), @@ -55,15 +55,15 @@ WITH migration_in_found LEFT JOIN migration_in_updated ON migration_in_found.id = migration_in_updated.id ), - vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $16) AS id), + vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $17) AS id), vmm_updated AS ( UPDATE vmm SET - time_state_updated = $17, state_generation = $18, state = $19 + time_state_updated = $18, state_generation = $19, state = $20 WHERE - ((vmm.time_deleted IS NULL) AND vmm.id = $20) AND vmm.state_generation < $21 + ((vmm.time_deleted IS NULL) AND vmm.id = $21) AND vmm.state_generation < $22 RETURNING id ), diff --git a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_migration_out.sql b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_migration_out.sql index eb4e558d95d..c02b73e4f60 100644 --- a/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_migration_out.sql +++ b/nexus/db-queries/tests/output/instance_and_vmm_update_vmm_instance_and_migration_out.sql @@ -41,9 +41,9 @@ WITH UPDATE migration SET - source_state = $11, time_source_updated = $12 + source_state = $11, time_source_updated = $12, source_gen = $13 WHERE - (migration.id = $13 AND migration.source_propolis_id = $14) AND migration.source_gen < $15 + (migration.id = $14 AND migration.source_propolis_id = $15) AND migration.source_gen < $16 RETURNING id ), @@ -55,15 +55,15 @@ WITH migration_out_found LEFT JOIN migration_out_updated ON migration_out_found.id = migration_out_updated.id ), - vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $16) AS id), + vmm_found AS (SELECT (SELECT vmm.id FROM vmm WHERE vmm.id = $17) AS id), vmm_updated AS ( UPDATE vmm SET - time_state_updated = $17, state_generation = $18, state = $19 + time_state_updated = $18, state_generation = $19, state = $20 WHERE - ((vmm.time_deleted IS NULL) AND vmm.id = $20) AND vmm.state_generation < $21 + ((vmm.time_deleted IS NULL) AND vmm.id = $21) AND vmm.state_generation < $22 RETURNING id ),