aboutsummaryrefslogtreecommitdiff
path: root/backend/migrations/2021-12-18-130837_bots/up.sql
blob: 27f3582ccb5d557530bf6df095518e78496334e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
CREATE TABLE bots (
    id serial PRIMARY KEY,
    owner_id integer REFERENCES users(id) NOT NULL,
    name text NOT NULL
);

CREATE UNIQUE INDEX bots_index ON bots(owner_id, name);

CREATE TABLE code_bundles (
    id serial PRIMARY KEY,
    bot_id integer REFERENCES bots(id) NOT NULL,
    path text NOT NULL,
    created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);