feat(database): adopt goose migrations (#62)

This commit is contained in:
Quick
2026-06-06 23:51:30 -04:00
committed by GitHub
parent 6564ee235a
commit 31b2716089
352 changed files with 2926 additions and 1766 deletions
+19
View File
@@ -0,0 +1,19 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE plugin_archives (
plugin_installation_id BIGINT PRIMARY KEY REFERENCES plugin_installations(id) ON DELETE CASCADE,
manifest_json BYTEA NOT NULL,
checksum TEXT NOT NULL,
archive_bytes BYTEA NOT NULL,
CONSTRAINT plugin_archives_manifest_json_not_empty CHECK (octet_length(manifest_json) > 0),
CONSTRAINT plugin_archives_checksum_not_empty CHECK (length(checksum) > 0),
CONSTRAINT plugin_archives_archive_bytes_not_empty CHECK (octet_length(archive_bytes) > 0),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS plugin_archives;
-- +goose StatementEnd