From 56a7ae4dc1ee8ac985d848baf3b5449b235adde0 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Wed, 13 Dec 2023 14:35:24 +0800 Subject: [PATCH] add source column to entity_labels table --- packages/api/src/entity/entity_label.ts | 3 +++ .../migrations/0148.do.add_source_to_entity_labels.sql | 9 +++++++++ .../migrations/0148.undo.add_source_to_entity_labels.sql | 9 +++++++++ 3 files changed, 21 insertions(+) create mode 100755 packages/db/migrations/0148.do.add_source_to_entity_labels.sql create mode 100755 packages/db/migrations/0148.undo.add_source_to_entity_labels.sql diff --git a/packages/api/src/entity/entity_label.ts b/packages/api/src/entity/entity_label.ts index 794275128..53cd45f4d 100644 --- a/packages/api/src/entity/entity_label.ts +++ b/packages/api/src/entity/entity_label.ts @@ -13,4 +13,7 @@ export class EntityLabel { @Column('uuid') highlightId?: string | null + + @Column('text') + source!: string } diff --git a/packages/db/migrations/0148.do.add_source_to_entity_labels.sql b/packages/db/migrations/0148.do.add_source_to_entity_labels.sql new file mode 100755 index 000000000..d5a5fd03f --- /dev/null +++ b/packages/db/migrations/0148.do.add_source_to_entity_labels.sql @@ -0,0 +1,9 @@ +-- Type: DO +-- Name: add_source_to_entity_labels +-- Description: Add source column to omnivore.entity_labels table + +BEGIN; + +ALTER TABLE omnivore.entity_labels ADD COLUMN source TEXT NOT NULL DEFAULT 'user'; + +COMMIT; diff --git a/packages/db/migrations/0148.undo.add_source_to_entity_labels.sql b/packages/db/migrations/0148.undo.add_source_to_entity_labels.sql new file mode 100755 index 000000000..f21d12e43 --- /dev/null +++ b/packages/db/migrations/0148.undo.add_source_to_entity_labels.sql @@ -0,0 +1,9 @@ +-- Type: UNDO +-- Name: add_source_to_entity_labels +-- Description: Add source column to omnivore.entity_labels table + +BEGIN; + +ALTER TABLE omnivore.entity_labels DROP COLUMN source; + +COMMIT;