From 6f54924a1f684161e4cd8faa99c87fac2d7d2bbb Mon Sep 17 00:00:00 2001 From: Acid Date: Mon, 1 Jun 2026 17:06:29 -0400 Subject: [PATCH] new file: seed.sql --- .gitignore | 3 +++ seed.sql | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 seed.sql diff --git a/.gitignore b/.gitignore index fda97e8..014727a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ test.py binary tmp/ scrap/ +*.sqlite3 +*.db +init.sql diff --git a/seed.sql b/seed.sql new file mode 100644 index 0000000..acae6c2 --- /dev/null +++ b/seed.sql @@ -0,0 +1,26 @@ + +--@BLOCK +-- Levels table (lookup/reference table) +CREATE TABLE levels ( + id SERIAL PRIMARY KEY, + name VARCHAR(255) NOT NULL +); + +-- Insert the 4 level types +INSERT INTO levels (name) VALUES + ('debug'), + ('info'), + ('warning'), + ('error'); + + +-- Create table +CREATE TABLE logs( + id SERIAL PRIMARY KEY, + level_id VARCHAR(255) NOT NULL, + ip VARCHAR(255), + date timestamp, + repeating INT, + + FOREIGN KEY (level_id) REFERENCES levels(id) +);