modified: seed.sql
This commit is contained in:
@@ -2,4 +2,7 @@ module acidburnmonkey/acidarchon
|
|||||||
|
|
||||||
go 1.26.2
|
go 1.26.2
|
||||||
|
|
||||||
require github.com/joho/godotenv v1.5.1 // indirect
|
require (
|
||||||
|
github.com/joho/godotenv v1.5.1 // indirect
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.44 // indirect
|
||||||
|
)
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.44 h1:3VSe+xafpbzsLbdr2AWlAZk9yRHiBhTBakioXaCKTF8=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.44/go.mod h1:pjEuOr8IwzLJP2MfGeTb0A35jauH+C2kbHKBr7yXKVQ=
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
|
_ "github.com/mattn/go-sqlite3"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ipResponse struct {
|
type ipResponse struct {
|
||||||
|
|||||||
@@ -1,26 +1,8 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS logs (
|
||||||
--@BLOCK
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
-- Levels table (lookup/reference table)
|
level TEXT NOT NULL CHECK(level IN ('debug', 'info', 'warning', 'error')),
|
||||||
CREATE TABLE levels (
|
ip TEXT,
|
||||||
id SERIAL PRIMARY KEY,
|
traceback TEXT,
|
||||||
name VARCHAR(255) NOT NULL
|
date DATETIME,
|
||||||
);
|
repeating INTEGER
|
||||||
|
|
||||||
-- 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