0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 10:38:13 -05:00

Add an internal approach to prevent xlog gc to remove file changes

This commit is contained in:
Andrey Antukh 2023-08-03 11:50:39 +02:00
parent 804addfa66
commit 1190cf837b
3 changed files with 14 additions and 1 deletions

View file

@ -324,6 +324,9 @@
{:name "0104-mod-file-thumbnail-table"
:fn (mg/resource "app/migrations/sql/0104-mod-file-thumbnail-table.sql")}
{:name "0105-mod-file-change-table"
:fn (mg/resource "app/migrations/sql/0105-mod-file-change-table.sql")}
])
(defn apply-migrations!

View file

@ -0,0 +1,9 @@
ALTER TABLE file_change
ADD COLUMN label text NULL;
ALTER TABLE file_change
ALTER COLUMN label SET STORAGE external;
CREATE INDEX file_change__label__idx
ON file_change (file_id, label)
WHERE label is not null;

View file

@ -17,7 +17,8 @@
(def ^:private
sql:delete-files-xlog
"delete from file_change
where created_at < now() - ?::interval")
where created_at < now() - ?::interval
and label is NULL")
(defmethod ig/pre-init-spec ::handler [_]
(s/keys :req [::db/pool]))