gems: Generalise gem transaction table.
Updates gem audit table for more generality. Fixes issue with `Row._refresh()`. Data migration v11 -> v12. Remove `set_gems` (not needed due to gem module refactor).
This commit is contained in:
27
data/migration/v11-v12/migration.sql
Normal file
27
data/migration/v11-v12/migration.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- Add gem support
|
||||
ALTER TABLE user_config ADD COLUMN gems INTEGER DEFAULT 0;
|
||||
|
||||
-- LionGem audit log {{{
|
||||
CREATE TYPE GemTransactionType AS ENUM (
|
||||
'ADMIN',
|
||||
'GIFT',
|
||||
'PURCHASE',
|
||||
'AUTOMATIC'
|
||||
);
|
||||
|
||||
CREATE TABLE gem_transactions(
|
||||
transactionid SERIAL PRIMARY KEY,
|
||||
transaction_type GemTransactionType NOT NULL,
|
||||
actorid BIGINT NOT NULL,
|
||||
from_account BIGINT,
|
||||
to_account BIGINT,
|
||||
amount INTEGER NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
note TEXT,
|
||||
reference TEXT,
|
||||
_timestamp TIMESTAMPTZ DEFAULT now()
|
||||
);
|
||||
CREATE INDEX gem_transactions_from ON gem_transactions (from_account);
|
||||
-- }}}
|
||||
|
||||
INSERT INTO VersionHistory (version, author) VALUES (12, 'v11-v12 migration');
|
||||
Reference in New Issue
Block a user