From f5a64c1eda12c42e9b5ce47644da82957e98ba18 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Thu, 25 Apr 2024 01:09:34 -0400 Subject: [PATCH] migration: jobs dismissal --- .../down.sql | 5 +++++ .../up.sql | 7 +++++++ _sql/migrations_squashed/generic_inference_jobs.sql | 5 +++++ 3 files changed, 17 insertions(+) create mode 100644 _sql/migrations/2024-04-25-050626_alter_generic_inference_jobs_add_dismissed/down.sql create mode 100644 _sql/migrations/2024-04-25-050626_alter_generic_inference_jobs_add_dismissed/up.sql diff --git a/_sql/migrations/2024-04-25-050626_alter_generic_inference_jobs_add_dismissed/down.sql b/_sql/migrations/2024-04-25-050626_alter_generic_inference_jobs_add_dismissed/down.sql new file mode 100644 index 0000000000..757fe62dc2 --- /dev/null +++ b/_sql/migrations/2024-04-25-050626_alter_generic_inference_jobs_add_dismissed/down.sql @@ -0,0 +1,5 @@ +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +ALTER TABLE generic_inference_jobs DROP COLUMN is_dismissed_by_user; diff --git a/_sql/migrations/2024-04-25-050626_alter_generic_inference_jobs_add_dismissed/up.sql b/_sql/migrations/2024-04-25-050626_alter_generic_inference_jobs_add_dismissed/up.sql new file mode 100644 index 0000000000..26322eda10 --- /dev/null +++ b/_sql/migrations/2024-04-25-050626_alter_generic_inference_jobs_add_dismissed/up.sql @@ -0,0 +1,7 @@ +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +ALTER TABLE generic_inference_jobs + ADD COLUMN is_dismissed_by_user BOOLEAN NOT NULL DEFAULT FALSE + AFTER attempt_count; diff --git a/_sql/migrations_squashed/generic_inference_jobs.sql b/_sql/migrations_squashed/generic_inference_jobs.sql index bb2eaa22be..eea9c52790 100644 --- a/_sql/migrations_squashed/generic_inference_jobs.sql +++ b/_sql/migrations_squashed/generic_inference_jobs.sql @@ -198,6 +198,11 @@ CREATE TABLE generic_inference_jobs ( -- We can track this against a "max_attempt_count" attempt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0, + -- If the user chooses to no longer display or poll the job, we mark this flag true. + -- This can only be set for terminal state (completed or failed) jobs. + -- We use this flag to remove the job from the user's view. + is_dismissed_by_user BOOLEAN NOT NULL DEFAULT FALSE, + -- If there is a failure, tell the user why. -- This isn't localized or very friendly to present to the user. failure_reason VARCHAR(512) DEFAULT NULL,