Files
ohrwurm/migrations/20240620151940_init.sql
Johannes Heuel 8985945659
All checks were successful
tests / fmt (push) Successful in 1m46s
tests / clippy (push) Successful in 1m48s
tests / test (push) Successful in 1m50s
tests / pre-commit (push) Successful in 2m5s
tests / build (push) Successful in 2m31s
deploy / release-image (push) Successful in 5m44s
add database
2024-06-20 20:16:19 +02:00

35 lines
712 B
SQL

-- Add migration script here
CREATE TABLE IF NOT EXISTS tracks
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
url TEXT NOT NULL UNIQUE,
title TEXT NOT NULL,
channel TEXT NOT NULL,
duration TEXT NOT NULL,
thumbnail TEXT NOT NULL,
updated DATETIME NOT NULL
);
CREATE TABLE IF NOT EXISTS queries
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id TEXT NOT NULL,
guild_id TEXT NOT NULL,
track_id NUMBER NOT NULL,
updated DATETIME NOT NULL
);
CREATE TABLE IF NOT EXISTS users
(
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
global_name TEXT,
updated DATETIME NOT NULL
);
CREATE TABLE IF NOT EXISTS guilds
(
id TEXT PRIMARY KEY,
updated DATETIME NOT NULL
);