mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
♻️ Refactor file changes gc tasks
Make it more friendly with the current snapshoting mechanism
This commit is contained in:
parent
5f4af76d28
commit
32126d1874
8 changed files with 133 additions and 97 deletions
|
@ -0,0 +1,18 @@
|
|||
ALTER TABLE file_change
|
||||
ADD COLUMN updated_at timestamptz DEFAULT now(),
|
||||
ADD COLUMN deleted_at timestamptz DEFAULT NULL,
|
||||
ALTER COLUMN created_at SET DEFAULT now();
|
||||
|
||||
DROP INDEX file_change__created_at__idx;
|
||||
DROP INDEX file_change__created_at__label__idx;
|
||||
DROP INDEX file_change__label__idx;
|
||||
|
||||
CREATE INDEX file_change__deleted_at__idx
|
||||
ON file_change (deleted_at, id)
|
||||
WHERE deleted_at IS NOT NULL;
|
||||
|
||||
CREATE INDEX file_change__system_snapshots__idx
|
||||
ON file_change (file_id, created_at)
|
||||
WHERE data IS NOT NULL
|
||||
AND created_by = 'system'
|
||||
AND deleted_at IS NULL;
|
Loading…
Add table
Add a link
Reference in a new issue