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