generated from VLADIMIR/template
add scenarios methods
This commit is contained in:
@@ -5,7 +5,7 @@ CREATE TABLE
|
||||
username VARCHAR(50) NOT NULL UNIQUE,
|
||||
email VARCHAR(100) NOT NULL UNIQUE,
|
||||
password_hash VARCHAR(255) NOT NULL,
|
||||
roles jsonb NOT NULL DEFAULT '[]'::jsonb,
|
||||
roles JSONB NOT NULL DEFAULT '[]'::jsonb,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT NOW ()
|
||||
);
|
||||
|
||||
@@ -6,6 +6,7 @@ CREATE TABLE
|
||||
expires_at TIMESTAMP NOT NULL,
|
||||
jti VARCHAR(255) NOT NULL UNIQUE,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT NOW (),
|
||||
|
||||
CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE
|
||||
IF NOT EXISTS scenarios (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL UNIQUE,
|
||||
description TEXT,
|
||||
image TEXT,
|
||||
scenario JSONB NOT NULL DEFAULT '{}'::jsonb,
|
||||
author_id INTEGER NOT NULL,
|
||||
status VARCHAR(50) DEFAULT 'draft',
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT NOW (),
|
||||
created_at TIMESTAMP NOT NULL DEFAULT NOW (),
|
||||
published_at TIMESTAMP,
|
||||
is_deleted BOOLEAN DEFAULT FALSE,
|
||||
|
||||
CONSTRAINT fk_scenarios_author FOREIGN KEY (author_id) REFERENCES users (id) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE IF EXISTS scenarios;
|
||||
Reference in New Issue
Block a user