-
Notifications
You must be signed in to change notification settings - Fork 1
Add worker runs and plan UI #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| DROP INDEX IF EXISTS execution_log_dataset_product_run_idx; | ||
| DROP TABLE IF EXISTS execution_log; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| CREATE TABLE execution_log ( | ||
| log_id BIGSERIAL PRIMARY KEY, | ||
| dataset_id UUID NOT NULL, | ||
| data_product_id UUID NOT NULL, | ||
| run_id UUID NOT NULL, | ||
| stream TEXT NOT NULL, | ||
| message TEXT NOT NULL, | ||
| created_by TEXT NOT NULL, | ||
| created_at TIMESTAMPTZ NOT NULL, | ||
| FOREIGN KEY(dataset_id, data_product_id) REFERENCES data_product(dataset_id, data_product_id) | ||
| ); | ||
|
|
||
| CREATE INDEX execution_log_dataset_product_run_idx | ||
| ON execution_log (dataset_id, data_product_id, run_id, log_id); | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,4 @@ | ||||||||||||||||||
| DROP TABLE plan_run_dependency; | ||||||||||||||||||
| DROP TABLE plan_run_data_product; | ||||||||||||||||||
| DROP INDEX plan_run_dataset_created_idx; | ||||||||||||||||||
| DROP TABLE plan_run; | ||||||||||||||||||
|
Comment on lines
+1
to
+4
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix DROP order: index must be dropped before its parent table. The index Additionally, consider using 🔧 Proposed fix-DROP TABLE plan_run_dependency;
-DROP TABLE plan_run_data_product;
-DROP INDEX plan_run_dataset_created_idx;
-DROP TABLE plan_run;
+DROP INDEX IF EXISTS plan_run_dataset_created_idx;
+DROP TABLE IF EXISTS plan_run_dependency;
+DROP TABLE IF EXISTS plan_run_data_product;
+DROP TABLE IF EXISTS plan_run;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| CREATE TABLE plan_run ( | ||
| plan_run_id UUID PRIMARY KEY, | ||
| dataset_id UUID NOT NULL, | ||
| status state NOT NULL, | ||
| created_by TEXT NOT NULL, | ||
| created_at TIMESTAMPTZ NOT NULL, | ||
| modified_by TEXT NOT NULL, | ||
| modified_date TIMESTAMPTZ NOT NULL, | ||
| FOREIGN KEY(dataset_id) REFERENCES dataset(dataset_id) | ||
| ); | ||
|
|
||
| CREATE INDEX plan_run_dataset_created_idx | ||
| ON plan_run(dataset_id, created_at DESC); | ||
|
|
||
| CREATE TABLE plan_run_data_product ( | ||
| plan_run_id UUID NOT NULL, | ||
| dataset_id UUID NOT NULL, | ||
| data_product_id UUID NOT NULL, | ||
| compute compute NOT NULL, | ||
| name TEXT NOT NULL, | ||
| version TEXT NOT NULL, | ||
| eager BOOL NOT NULL, | ||
| state state NOT NULL, | ||
| step_run_id UUID, | ||
| link TEXT, | ||
| passback JSONB, | ||
| modified_by TEXT NOT NULL, | ||
| modified_date TIMESTAMPTZ NOT NULL, | ||
| PRIMARY KEY(plan_run_id, data_product_id), | ||
| FOREIGN KEY(plan_run_id) REFERENCES plan_run(plan_run_id) ON DELETE CASCADE | ||
| ); | ||
|
|
||
| CREATE INDEX plan_run_data_product_step_run_idx | ||
| ON plan_run_data_product(step_run_id); | ||
|
|
||
| CREATE TABLE plan_run_dependency ( | ||
| plan_run_id UUID NOT NULL, | ||
| dataset_id UUID NOT NULL, | ||
| parent_id UUID NOT NULL, | ||
| child_id UUID NOT NULL, | ||
| PRIMARY KEY(plan_run_id, parent_id, child_id), | ||
| FOREIGN KEY(plan_run_id) REFERENCES plan_run(plan_run_id) ON DELETE CASCADE | ||
| ); | ||
|
Comment on lines
+15
to
+43
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enforce that child Both snapshot tables persist Constraint fix CREATE TABLE plan_run (
plan_run_id UUID PRIMARY KEY,
dataset_id UUID NOT NULL,
status state NOT NULL,
created_by TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL,
modified_by TEXT NOT NULL,
modified_date TIMESTAMPTZ NOT NULL,
- FOREIGN KEY(dataset_id) REFERENCES dataset(dataset_id)
+ FOREIGN KEY(dataset_id) REFERENCES dataset(dataset_id),
+ UNIQUE(plan_run_id, dataset_id)
);
@@
CREATE TABLE plan_run_data_product (
@@
- FOREIGN KEY(plan_run_id) REFERENCES plan_run(plan_run_id) ON DELETE CASCADE
+ FOREIGN KEY(plan_run_id, dataset_id)
+ REFERENCES plan_run(plan_run_id, dataset_id)
+ ON DELETE CASCADE
);
@@
CREATE TABLE plan_run_dependency (
@@
- FOREIGN KEY(plan_run_id) REFERENCES plan_run(plan_run_id) ON DELETE CASCADE
+ FOREIGN KEY(plan_run_id, dataset_id)
+ REFERENCES plan_run(plan_run_id, dataset_id)
+ ON DELETE CASCADE
);🤖 Prompt for AI Agents |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an integrity constraint for
run_id.run_idis now part of the log identity, but this table only constrains(dataset_id, data_product_id). That means a bad callback can persist logs for a nonexistent or wrong run and the row will still be valid. Please tieexecution_log.run_idto the table that owns step runs/historical snapshots so logs cannot be misattributed.🤖 Prompt for AI Agents