up
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE game_returns (
|
||||
package_id TEXT PRIMARY KEY,
|
||||
sha256 TEXT NOT NULL,
|
||||
export_id TEXT NOT NULL REFERENCES game_exports(id) ON DELETE RESTRICT,
|
||||
source_game_id INTEGER NOT NULL,
|
||||
prepared_at TEXT NOT NULL,
|
||||
applied_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp(),
|
||||
mappings JSONB NOT NULL,
|
||||
local_actors JSONB NOT NULL,
|
||||
initiator_id INTEGER REFERENCES users(id) ON DELETE SET NULL,
|
||||
UNIQUE (export_id, prepared_at)
|
||||
);
|
||||
CREATE INDEX game_returns_game ON game_returns(source_game_id);
|
||||
CREATE INDEX game_returns_export ON game_returns(export_id, prepared_at DESC);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE game_returns;
|
||||
Reference in New Issue
Block a user