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

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

CREATE INDEX code_bundles_bot_id_index ON code_bundles(bot_id);
CREATE INDEX code_bundles_created_at_index ON code_bundles(created_at);