From 8619c00a209ffc5d68986c1bc346c944a74db442 Mon Sep 17 00:00:00 2001 From: Lucas Schumacher Date: Mon, 30 Oct 2023 13:20:09 -0400 Subject: [PATCH] Add database --- .gitignore | 1 + db.env | 1 + migrations/0001_user_table.sql | 7 +++++++ 3 files changed, 9 insertions(+) create mode 100644 db.env create mode 100644 migrations/0001_user_table.sql diff --git a/.gitignore b/.gitignore index 315c565..0402771 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ target chat.db +chat.db* diff --git a/db.env b/db.env new file mode 100644 index 0000000..1cfdc43 --- /dev/null +++ b/db.env @@ -0,0 +1 @@ +export DATABASE_URL="sqlite:chat.db" diff --git a/migrations/0001_user_table.sql b/migrations/0001_user_table.sql new file mode 100644 index 0000000..4f89790 --- /dev/null +++ b/migrations/0001_user_table.sql @@ -0,0 +1,7 @@ +create table users ( + -- id INT NOT NULL AUTO_INCREMENT, + username VARCHAR NOT NULL UNIQUE, + password TEXT NOT NULL, + admin BOOLEAN NOT NULL DEFAULT FALSE, + PRIMARY KEY (username) +);