From 05b386ad791a8a8fd950169b4fa3d0ccceec1630 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Sat, 11 Nov 2023 11:28:16 +0800 Subject: [PATCH] migrate existing data --- packages/db/migrations/0146.do.following.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/db/migrations/0146.do.following.sql b/packages/db/migrations/0146.do.following.sql index 44afe8da5..30d92256c 100755 --- a/packages/db/migrations/0146.do.following.sql +++ b/packages/db/migrations/0146.do.following.sql @@ -14,6 +14,9 @@ ALTER TABLE omnivore.library_item ADD COLUMN preview_content_type text, ADD COLUMN folder text NOT NULL DEFAULT 'inbox'; +UPDATE omnivore.library_item SET folder = 'archive' WHERE archived_at IS NOT NULL; +UPDATE omnivore.library_item SET folder = 'trash' WHERE deleted_at IS NOT NULL; + CREATE POLICY library_item_admin_policy on omnivore.library_item FOR ALL TO omnivore_admin