Skip to content

Commit

Permalink
fix(migration): migrate unsupported task to custom (#709)
Browse files Browse the repository at this point in the history
Because

- we have not support `TASK_IMAGE_TO_IMAGE` in the new AI Task standard

This commit

- migrate unsupported task to `TASK_CUSTOM
  • Loading branch information
heiruwu authored Nov 5, 2024
1 parent 2940b1c commit a40a839
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ database:
host: pg-sql
port: 5432
name: model
version: 11
version: 12
timezone: Etc/UTC
pool:
idleconnections: 5
Expand Down
4 changes: 2 additions & 2 deletions pkg/db/migration/000011_run_logging_namespace.down.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BEGIN;

comment on column model_trigger.requester_uid is null;
COMMENT ON COLUMN model_trigger.requester_uid IS NULL;

alter table model_trigger drop column runner_uid;
ALTER TABLE model_trigger DROP COLUMN runner_uid;

COMMIT;
12 changes: 6 additions & 6 deletions pkg/db/migration/000011_run_logging_namespace.up.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
BEGIN;

alter table model_trigger
add runner_uid uuid;
ALTER TABLE model_trigger
ADD runner_uid uuid;

comment on column model_trigger.requester_uid is 'run by namespace, which is the credit owner';
COMMENT ON COLUMN model_trigger.requester_uid IS 'run by namespace, which is the credit owner';

update model_trigger
set runner_uid = requester_uid
where runner_uid is null;
UPDATE model_trigger
SET runner_uid = requester_uid
WHERE runner_uid IS NULL;

COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN;

UPDATE model SET task = 'TASK_CUSTOM' WHERE task = 'TASK_IMAGE_TO_IMAGE';

COMMIT;
5 changes: 5 additions & 0 deletions pkg/db/migration/000012_migrate_unsupported_task.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN;

UPDATE model SET task = 'TASK_IMAGE_TO_IMAGE' WHERE task = 'TASK_CUSTOM';

COMMIT;

0 comments on commit a40a839

Please sign in to comment.