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 Remove trailing whitespace 2013-01-22 14:41:02 +01:00
upgrade-3.sql
upgrade-4.sql
upgrade-5.sql
upgrade-6.sql Remove trailing whitespace 2013-01-22 14:41:02 +01:00
upgrade-7.sql
upgrade-8.sql Add missing file 2013-01-23 12:49:44 +01:00
upgrade-9.sql Add missing files 2013-02-14 11:53:09 +01:00
upgrade-10.sql Support push notification of repository changes 2013-02-25 21:10:32 +01:00
upgrade-11.sql Remove the BuildMachines and BuildMachinesSystemTypes tables 2013-03-04 16:32:16 -05:00
upgrade-12.sql Allow a per-jobset check interval 2013-05-02 17:55:47 +02:00
upgrade-13.sql Allow a per-jobset check interval 2013-05-02 17:55:47 +02:00
upgrade-14.sql Drop unused "disabled" columns 2013-05-03 16:39:17 +02:00
upgrade-15.sql Ensure that stoptime and starttime are set for finished builds 2013-05-23 12:05:12 -04:00
upgrade-16.sql Remove unused Jobs columns 2013-05-23 12:12:19 -04:00
upgrade-17.sql Materialize the number of finished builds 2013-08-12 20:19:10 +02:00
upgrade-18.sql Index builds on stop time 2013-08-12 20:19:10 +02:00
upgrade-19.sql Rename aggregate members to constituents 2013-08-15 02:33:10 +02:00
upgrade-20.sql Fix the Darcs schema upgrade 2013-09-19 12:00:29 +00:00
upgrade-21.sql hydra-queue-runner: Improved scheduling 2013-09-21 14:57:01 +00:00
upgrade-22.sql Distinguish between permanent evaluation errors and transient input errors 2013-09-25 16:21:16 +02:00
upgrade-23.sql Add a dashboard 2013-10-14 20:07:26 +02:00
upgrade-24.sql Merge remote-tracking branch 'upstream/who-broke-builds' into upstream-master 2013-10-15 09:49:20 -04:00
upgrade-25.sql Store the account type ("hydra" or "persona") explicitly in the database 2013-11-05 11:46:05 +01:00
upgrade-26.sql When renaming a jobset, add a redirect from the old name 2014-04-23 23:15:22 +02:00
upgrade-27.sql Remove support for views 2014-04-23 23:22:44 +02:00
upgrade-28.sql Drop the errorMsg column in the Jobs table 2014-09-29 19:46:11 +02:00
upgrade-29.sql Get rid of some obsolete indexes 2014-09-30 15:44:08 +02:00
upgrade-30.sql Use partial indexes 2014-09-30 15:44:08 +02:00
upgrade-31.sql Remove the longDescription field 2014-09-30 15:44:09 +02:00
upgrade-32.sql Record which build a failed build step was propagated from 2015-02-25 16:42:32 +01:00
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