planetwars.dev/planetwars-server/migrations/2021-12-18-130837_bots/up.sql
2022-02-27 22:58:11 +01:00

15 lines
No EOL
442 B
SQL

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);