add db connection, refactor code, add db migration files
This commit is contained in:
20
db/migrations/000003_create_systems.up.sql
Normal file
20
db/migrations/000003_create_systems.up.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
CREATE TABLE IF NOT EXISTS systems (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
text_id VARCHAR(256) NOT NULL,
|
||||
title VARCHAR(256) NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
url VARCHAR(256) NOT NULL,
|
||||
download VARCHAR(256) NOT NULL,
|
||||
|
||||
created_at DATETIME NOT NULL DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS systems_compatibility (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
system_id INTEGER UNIQUE,
|
||||
minimum VARCHAR(64) NOT NULL,
|
||||
verified VARCHAR(64) NOT NULL,
|
||||
maximum VARCHAR(64) NOT NULL,
|
||||
|
||||
FOREIGN KEY (system_id) REFERENCES systems(id) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user