fix: enhance publish record deletion logic and add soft delete functionality
Backend CI / Backend (push) Successful in 14m47s
Backend CI / Backend (push) Successful in 14m47s
This commit is contained in:
@@ -1,9 +1,2 @@
|
||||
DROP INDEX CONCURRENTLY IF EXISTS idx_publish_records_visible_status;
|
||||
|
||||
DROP INDEX CONCURRENTLY IF EXISTS idx_publish_records_article_account_active;
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_publish_records_article_account_active
|
||||
ON publish_records (tenant_id, article_id, platform_account_id, updated_at DESC, id DESC)
|
||||
WHERE status IN ('queued', 'publishing', 'success');
|
||||
|
||||
ALTER TABLE publish_records
|
||||
DROP COLUMN IF EXISTS deleted_at;
|
||||
|
||||
@@ -1,12 +1,2 @@
|
||||
ALTER TABLE publish_records
|
||||
ADD COLUMN IF NOT EXISTS deleted_at TIMESTAMPTZ;
|
||||
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_publish_records_visible_status
|
||||
ON publish_records (tenant_id, status, created_at DESC, id DESC)
|
||||
WHERE deleted_at IS NULL;
|
||||
|
||||
DROP INDEX CONCURRENTLY IF EXISTS idx_publish_records_article_account_active;
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_publish_records_article_account_active
|
||||
ON publish_records (tenant_id, article_id, platform_account_id, updated_at DESC, id DESC)
|
||||
WHERE status IN ('queued', 'publishing', 'success')
|
||||
AND deleted_at IS NULL;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
DROP INDEX CONCURRENTLY IF EXISTS idx_publish_records_visible_status;
|
||||
@@ -0,0 +1,3 @@
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_publish_records_visible_status
|
||||
ON publish_records (tenant_id, status, created_at DESC, id DESC)
|
||||
WHERE deleted_at IS NULL;
|
||||
@@ -0,0 +1,3 @@
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_publish_records_article_account_active
|
||||
ON publish_records (tenant_id, article_id, platform_account_id, updated_at DESC, id DESC)
|
||||
WHERE status IN ('queued', 'publishing', 'success');
|
||||
@@ -0,0 +1 @@
|
||||
DROP INDEX CONCURRENTLY IF EXISTS idx_publish_records_article_account_active;
|
||||
@@ -0,0 +1 @@
|
||||
DROP INDEX CONCURRENTLY IF EXISTS idx_publish_records_article_account_active;
|
||||
@@ -0,0 +1,4 @@
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_publish_records_article_account_active
|
||||
ON publish_records (tenant_id, article_id, platform_account_id, updated_at DESC, id DESC)
|
||||
WHERE status IN ('queued', 'publishing', 'success')
|
||||
AND deleted_at IS NULL;
|
||||
Reference in New Issue
Block a user