new file: seed.sql
This commit is contained in:
@@ -8,3 +8,6 @@ test.py
|
||||
binary
|
||||
tmp/
|
||||
scrap/
|
||||
*.sqlite3
|
||||
*.db
|
||||
init.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)
|
||||
);
|
||||
Reference in New Issue
Block a user