planetwars.dev/planetwars-server/migrations/2021-12-18-130837_bots/up.sql
2021-12-30 11:45:59 +01:00

14 lines
No EOL
373 B
SQL

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