add db connection, refactor code, add db migration files
This commit is contained in:
15
db/migrations/000001_create_foundry_state.up.sql
Normal file
15
db/migrations/000001_create_foundry_state.up.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
CREATE TABLE IF NOT EXISTS foundry_state (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
is_admin BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
is_setup BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
state_type INTEGER NOT NULL,
|
||||
|
||||
created_at DATETIME NOT NULL DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS options (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
state_id INTEGER UNIQUE,
|
||||
lang TEXT NOT NULL,
|
||||
FOREIGN KEY (state_id) REFERENCES foundry_state(id) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user