初始化

This commit is contained in:
Ran
2026-08-25 17:59:42 +08:00
commit 4b7380dd9b
408 changed files with 327400 additions and 0 deletions
@@ -0,0 +1,13 @@
CREATE TABLE script_analyses (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
user_id uuid NOT NULL REFERENCES web_users(id) ON DELETE CASCADE,
name citext NOT NULL,
source_content text NOT NULL DEFAULT '',
result_content text NOT NULL DEFAULT '',
created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
deleted_at timestamptz
);
CREATE INDEX idx_script_analyses_user_updated ON script_analyses(user_id, updated_at DESC) WHERE deleted_at IS NULL;
CREATE TRIGGER script_analyses_updated_at BEFORE UPDATE ON script_analyses FOR EACH ROW EXECUTE FUNCTION set_updated_at();