aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-scripts/migrations/20250326160051_create_scripts.up.sql
blob: 1b2f36889385666ea9a7e6812dd0f02fc7e2224b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- Add up migration script here
CREATE TABLE scripts (
    id TEXT PRIMARY KEY,
    name TEXT NOT NULL,
    description TEXT NOT NULL,
    shebang TEXT NOT NULL,
    script TEXT NOT NULL,
    inserted_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
);

CREATE TABLE script_tags (
    id INTEGER PRIMARY KEY,
    script_id TEXT NOT NULL,
    tag TEXT NOT NULL
);

CREATE UNIQUE INDEX idx_script_tags ON script_tags (script_id, tag);