Fix sql scripts

This commit is contained in:
Josh-Heaps
2026-02-09 13:23:34 -07:00
parent dae8fbfe5e
commit a26ffec104
12 changed files with 20 additions and 1 deletions
+2 -1
View File
@@ -10,7 +10,8 @@
"Bash(cd:*)",
"Bash(tree:*)",
"Bash(del Index.cshtml Index.cshtml.cs)",
"Bash(dotnet build:*)"
"Bash(dotnet build:*)",
"Bash(find:*)"
],
"deny": [],
"ask": []
@@ -0,0 +1,2 @@
CREATE SCHEMA IF NOT EXISTS app
AUTHORIZATION josh;
@@ -0,0 +1,16 @@
CREATE TABLE IF NOT EXISTS app.users (
id BIGSERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
username VARCHAR(50) UNIQUE NOT NULL,
password_hash VARCHAR(255) NOT NULL,
is_active BOOLEAN DEFAULT TRUE,
email_verified BOOLEAN DEFAULT FALSE,
failed_login_attempts INTEGER DEFAULT 0,
locked_until TIMESTAMP NULL,
last_login TIMESTAMP NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_email ON app.users(email);
CREATE INDEX IF NOT EXISTS idx_username ON app.users(username);