new file: seed.sql

This commit is contained in:
Acid
2026-06-01 17:06:29 -04:00
parent 0d3515ad07
commit 6f54924a1f
2 changed files with 29 additions and 0 deletions
+26
View File
@@ -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)
);