[API] Job "priority" field defaults to "null", should default to "0"
The "priority" field is used to sort the job queue, and it defaults to null. Unfortunately, the database automatically puts "null" values first in the sorting order, preventing priority from working as intended. The API server should assign a default numeric priority of 0 when creating the model and a NOT NULL constraint should be added to the schema.
#8 Updated by Tom Clegg over 6 years ago
This index seems to have been removed from structure.sql in 80cbf4d9, not sure why/how:
-- Name: pipeline_instance_owner_uuid_name_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX pipeline_instance_owner_uuid_name_unique ON pipeline_instances USING btree (owner_uuid, name); --
It comes back automatically if I do rake db:migrate.
Other than that, LGTM. Thanks.
#9 Updated by Tom Clegg over 6 years ago
Ah, I get it (I think): the jobs_owner_uuid_name_unique and pipeline_instance_owner_uuid_name_unique indices stayed in db/structure.sql in the 3036 merge, even though they had been removed from the migration.
I've fixed my own database, so now it agrees with the migrations instead of agreeing with db/structure.sql. Now we just have to remove those two db/structure.sql entries so it agrees with the migrations. (Perhaps best to do it in a separate commit with refs #3036?)