add db connection, refactor code, add db migration files
This commit is contained in:
23
db/migrations/000004_create_worlds.up.sql
Normal file
23
db/migrations/000004_create_worlds.up.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
CREATE TABLE IF NOT EXISTS worlds (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
text_id VARCHAR(256) NOT NULL,
|
||||
title VARCHAR(256) NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
system VARCHAR(256) NOT NULL,
|
||||
core_version VARCHAR(256) NOT NULL,
|
||||
system_version VARCHAR(256) NOT NULL,
|
||||
playtime INTEGER NOT NULL,
|
||||
next_session DATETIME NOT NULL,
|
||||
|
||||
created_at DATETIME NOT NULL DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS worlds_compatibility (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
world_id INTEGER UNIQUE,
|
||||
minimum VARCHAR(64) NOT NULL,
|
||||
verified VARCHAR(64) NOT NULL,
|
||||
maximum VARCHAR(64) NOT NULL,
|
||||
|
||||
FOREIGN KEY (world_id) REFERENCES worlds(id) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user