hydra/src/sql
Ismaël Bouya 339a09f2e4
Fix check in jobsets
The current check happening in jobsets is incorrect.
The wanted constraint is stated as follow :
- If type is 0 (legacy), then the flake field should be null, and
  both nixExprInput and nixExprPath should be non-null
- If type is 1 (flake), then the flake field should be non-null, and
  both nixExprInput and nixExprPath should be null

The current version will not catch (i.e. it will accept) situations
where you have for instance :
type = 1, nixExprPath null, nixExprInput non-null, flake non-null

This commit fixes that.

I split(ted) that into two constraints, to make it more readable and
easier to extend if a new type appears in the future.

The complete query could be instead :
( type = 0
  AND nixExprInput IS NOT NULL AND nixExprPath IS NOT NULL AND flake IS NULL )
OR ( type = 1
  AND nixExprInput IS NULL AND nixExprPath IS NULL AND flake IS NOT NULL )

(but an "OR" cannot be split, hence the other formulation)
2021-02-03 22:14:53 +01:00
..
hydra.sql Fix check in jobsets 2021-02-03 22:14:53 +01:00
Makefile.am Remove references to hydra-postgresql.sql 2020-06-05 13:42:56 +02:00
test.sql
update-dbix-harness.sh sql: Stop loading SQL if an error occurs 2021-01-26 11:50:32 -05:00
update-dbix.pl Move evaluation errors from evaluations to EvaluationErrors, a new table 2021-02-01 21:33:14 -05:00
upgrade-2.sql
upgrade-3.sql
upgrade-4.sql
upgrade-5.sql
upgrade-6.sql
upgrade-7.sql
upgrade-8.sql
upgrade-9.sql
upgrade-10.sql
upgrade-11.sql
upgrade-12.sql
upgrade-13.sql
upgrade-14.sql
upgrade-15.sql
upgrade-16.sql
upgrade-17.sql
upgrade-18.sql
upgrade-19.sql
upgrade-20.sql
upgrade-21.sql
upgrade-22.sql
upgrade-23.sql
upgrade-24.sql
upgrade-25.sql
upgrade-26.sql
upgrade-27.sql
upgrade-28.sql
upgrade-29.sql
upgrade-30.sql
upgrade-31.sql
upgrade-32.sql
upgrade-33.sql Add forgotten file 2015-06-17 21:39:28 +02:00
upgrade-34.sql Add command ‘hydra-queue-runner --status’ to show current status 2015-06-22 14:06:44 +02:00
upgrade-35.sql Use triggers for all notifications on Builds table changes 2015-07-08 12:05:32 +02:00
upgrade-36.sql Index BuildSteps on propagatedFrom 2015-07-08 12:12:44 +02:00
upgrade-37.sql Add page showing latest build steps 2015-07-10 15:41:57 +02:00
upgrade-38.sql IndexJobsetEvalsOnJobsetId: Only index jobsets with new builds 2015-07-10 15:41:57 +02:00
upgrade-39.sql Add support for tracking custom metrics 2015-07-31 00:57:30 +02:00
upgrade-40.sql Allow build to be bumped to the front of the queue via the web interface 2015-08-10 16:19:47 +02:00
upgrade-41.sql Tweak 2015-10-16 16:59:07 +02:00
upgrade-42.sql Add isChannel column and meta attribute. 2015-09-10 17:36:38 +02:00
upgrade-43.sql Ignore non-existence of IndexBuildsOnFinishedBusy 2015-10-28 14:09:45 +01:00
upgrade-44.sql Remove the errorMsg column from the Builds table 2016-02-12 17:21:55 +01:00
upgrade-45.sql Keep track of the time we spend copying to/from build machines 2016-02-17 10:30:23 +01:00
upgrade-46.sql Unify build and step status codes 2016-03-09 15:30:43 +01:00
upgrade-47.sql Drop unused BuildProducts.description column 2016-04-13 16:30:52 +02:00
upgrade-48.sql Enable declarative projects. 2016-05-09 08:54:27 -04:00
upgrade-49.sql Allow public dashboards 2016-05-27 14:35:32 +02:00
upgrade-50.sql Fix SQL syntax for migration 50. It failed with PostgreSQL 9.4. (#416) 2016-12-09 18:18:17 +01:00
upgrade-51.sql When manually scheduling an eval, force re-instantiation of store derivations 2016-10-24 20:20:20 +02:00
upgrade-52.sql Allow determinism checking for entire jobsets 2016-12-07 15:57:13 +01:00
upgrade-53.sql hydra-evaluator improvements 2017-03-15 16:59:57 +01:00
upgrade-54.sql Fix a race that can cause hydra-queue-runner to ignore newly added builds 2017-07-21 14:34:48 +02:00
upgrade-55.sql hydra-queue-runner: Make build notification more reliable 2017-07-26 15:17:51 +02:00
upgrade-56.sql Distinguish build step states 2017-12-07 15:35:31 +01:00
upgrade-57.sql Create extension pg_trgm in the NixOS module 2019-07-25 16:19:33 +02:00
upgrade-58.sql Copy the flake migration from the flake branch 2020-02-09 15:21:28 -05:00
upgrade-59.sql Jobsets: add a SERIAL, unique, non-null id column 2020-02-10 11:42:59 -05:00
upgrade-60.sql Jobs: add a nullable jobset_id foreign key to Jobsets. 2020-02-10 11:43:02 -05:00
upgrade-61.sql Builds: add a nullable jobset_id foreign key to Jobsets. 2020-02-10 11:43:02 -05:00
upgrade-62.sql fixup: d'oh, make the migrations from #710 part-2 sequential 2020-02-11 08:36:14 -05:00
upgrade-63.sql fixup: d'oh, make the migrations from #710 part-2 sequential 2020-02-11 08:36:14 -05:00
upgrade-64.sql fixup: d'oh, make the migrations from #710 part-2 sequential 2020-02-11 08:36:14 -05:00
upgrade-65.sql hydra.sql: add an index for slow queries in production 2020-02-11 12:52:28 -05:00
upgrade-66.sql Add missing SQL upgrade script for NOT NULL on type 2020-05-18 10:59:55 +02:00
upgrade-67.sql Remove the Jobs table 2020-05-27 20:09:36 +02:00
upgrade-68.sql Fix some broken indices 2020-10-28 14:30:44 +01:00
upgrade-69.sql BuildOutputs: index path with HASH 2021-01-18 11:28:05 -05:00
upgrade-70.sql Schema: add errorMsg, errorTime to JobsetEvals 2021-01-21 13:10:41 -05:00
upgrade-71.sql Normalize nixexpr{input,path} from builds to jobsetevals. 2021-01-22 09:10:18 -05:00
upgrade-72.sql jobsetevals: refer to jobset by ID 2021-01-26 11:50:37 -05:00
upgrade-73.sql Move evaluation errors from evaluations to EvaluationErrors, a new table 2021-02-01 21:33:14 -05:00
upgrade-74.sql Fix check in jobsets 2021-02-03 22:14:53 +01:00