Repository navigation
Open
Description
Task Summary
Today each kind keeps its common parts in its own tables: 17 of the 42 tables are per-kind copies, such as the four *_user_access tables. This task adds the tables of #9395's model next to today's tables and fills them, without changing any of today's code.
Before
After
- Schema updates in every deployment. Today only local development applies
sql/updates: single-node and Helm loadtexera_ddl.sqlonly into a new database, and the Liquibase changelog lists only updates 23 to 52. Every deployment first needs to apply new updates by itself, and the jOOQ classes should be generated from the updates rather than from each developer's own database. - New tables.
resource(keyed by a randomrid),resource_version(keyed by(rid, vno)),access((rid, uid)with a level: own, write or read) andlineage. Every existing resource gets arid, and today's rows are copied in. - Kept in step. Triggers copy every write to today's tables into the new ones, so new code can read every kind while today's code does not change. When a kind moves to the resource service (Introduce the unified resource service and move each kind onto it #9489), its triggers are dropped and its old tables become read-only views with the same names, so code that still reads them keeps working until Remove the legacy resource routes, tables and services #9492 removes them.
Discussion points
- A kind's own fields: JSON in
resource.spec, checked against the API definition (Define the resource service's API in one contract and generate code from it #9485), or a table for every kind. With JSON, adding a field needs no migration, and a kind gets a table only when its fields need an index, a constraint or a foreign key. - Ids:
ridis a random UUID, so ids do not reveal how many resources exist (Design of sharing and access control of resources (computing units, datasets, and workflows) #3749). Old ids (wid,didand so on) stay as a mapping torid, because links and stored result paths contain them. - Executions: keep their own
eid, or become the weak entity that Design of sharing and access control of resources (computing units, datasets, and workflows) #3749 decided.
Done when every resource, grant and version has its row in the new tables, the triggers keep them current, and today's tests pass unchanged.
Task Type
- Refactor / Cleanup
- DevOps / Deployment / CI
- Testing / QA
- Documentation
- Performance
- Other
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Apply database schema updates automatically in every deployment[/-][+]Adjust the database schema for unified resource management[/+]