Skip to content

Soft delete DB rows#1820

Draft
xgraceyan wants to merge 7 commits into
mainfrom
gy/soft-delete
Draft

Soft delete DB rows#1820
xgraceyan wants to merge 7 commits into
mainfrom
gy/soft-delete

Conversation

@xgraceyan

Copy link
Copy Markdown
Contributor

Summary

Test Plan

Issues

Closes #1698

@@ -0,0 +1,6 @@
ALTER TABLE "schedules" ADD COLUMN "archived_at" timestamp with time zone;--> statement-breakpoint
ALTER TABLE "schedules" ALTER COLUMN "index" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "schedules" ADD CONSTRAINT "schedules_archive_index_consistency" CHECK (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this index consistency crap (which i know isn't your introduction) is absolutely hellish.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you recommend then? Maybe we can make the unique index only apply to active rows then that would remove the need for the consistency check

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dunno, i need to think/research it more — i just think that any time we do a constraint which isn't enforced by drizzle, we're really playing with fire

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Soft delete DB rows

2 participants