mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
✨ Add an internal approach to prevent xlog gc to remove file changes
This commit is contained in:
@@ -324,6 +324,9 @@
|
|||||||
{:name "0104-mod-file-thumbnail-table"
|
{:name "0104-mod-file-thumbnail-table"
|
||||||
:fn (mg/resource "app/migrations/sql/0104-mod-file-thumbnail-table.sql")}
|
: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!
|
(defn apply-migrations!
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -17,7 +17,8 @@
|
|||||||
(def ^:private
|
(def ^:private
|
||||||
sql:delete-files-xlog
|
sql:delete-files-xlog
|
||||||
"delete from file_change
|
"delete from file_change
|
||||||
where created_at < now() - ?::interval")
|
where created_at < now() - ?::interval
|
||||||
|
and label is NULL")
|
||||||
|
|
||||||
(defmethod ig/pre-init-spec ::handler [_]
|
(defmethod ig/pre-init-spec ::handler [_]
|
||||||
(s/keys :req [::db/pool]))
|
(s/keys :req [::db/pool]))
|
||||||
|
|||||||
Reference in New Issue
Block a user