feat: drop sqlite support
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m27s
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m27s
This commit is contained in:
parent
5e00060421
commit
da718427bd
27 changed files with 1296 additions and 115 deletions
|
|
@ -7,7 +7,7 @@ CREATE TABLE space_audit_logs (
|
|||
action TEXT NOT NULL,
|
||||
target_user_id TEXT REFERENCES users(id) ON DELETE SET NULL,
|
||||
target_email TEXT,
|
||||
metadata JSONB NOT NULL DEFAULT '{}',
|
||||
metadata JSONB NOT NULL DEFAULT '{}'::jsonb,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ CREATE TABLE transaction_audit_logs (
|
|||
transaction_id TEXT NOT NULL,
|
||||
actor_id TEXT REFERENCES users(id) ON DELETE SET NULL,
|
||||
action TEXT NOT NULL,
|
||||
metadata JSONB NOT NULL DEFAULT '{}',
|
||||
metadata JSONB NOT NULL DEFAULT '{}'::jsonb,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
-- The account-scoped activity feeds filter audit rows by metadata->>'account_id'.
|
||||
-- A partial expression index is the right shape for this access pattern in
|
||||
-- PostgreSQL 17: it is small (only the rows where the field exists), uses a
|
||||
-- standard B-tree (cheap equality + ORDER BY created_at), and avoids the bloat
|
||||
-- of a full GIN over the metadata document.
|
||||
|
||||
CREATE INDEX idx_space_audit_logs_account_id
|
||||
ON space_audit_logs ((metadata->>'account_id'), created_at DESC)
|
||||
WHERE action LIKE 'account.%';
|
||||
|
||||
CREATE INDEX idx_transaction_audit_logs_account_id
|
||||
ON transaction_audit_logs ((metadata->>'account_id'), created_at DESC)
|
||||
WHERE metadata ? 'account_id';
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
DROP INDEX IF EXISTS idx_space_audit_logs_account_id;
|
||||
DROP INDEX IF EXISTS idx_transaction_audit_logs_account_id;
|
||||
-- +goose StatementEnd
|
||||
Loading…
Add table
Add a link
Reference in a new issue