planetwars.dev/planetwars-server/migrations/2021-12-18-130837_bots/up.sql

15 lines
442 B
MySQL
Raw Normal View History

2021-12-18 23:16:46 +00:00
CREATE TABLE bots (
id serial PRIMARY KEY,
2022-02-26 22:07:13 +00:00
owner_id integer REFERENCES users(id),
2022-02-27 20:47:17 +00:00
name text UNIQUE NOT NULL
2021-12-18 23:16:46 +00:00
);
CREATE TABLE code_bundles (
id serial PRIMARY KEY,
bot_id integer REFERENCES bots(id),
2021-12-18 23:16:46 +00:00
path text NOT NULL,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
2022-02-27 21:58:11 +00:00
);
CREATE INDEX code_bundles_bot_id_index ON code_bundles(bot_id);
CREATE INDEX code_bundles_created_at_index ON code_bundles(created_at);