From 44d6620b32f31c04663c9e08a1c3954273230ee8 Mon Sep 17 00:00:00 2001 From: Samuel Johnson Date: Tue, 25 Nov 2025 20:52:35 -0500 Subject: Tidy the code --- internal/dbmigrations.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'internal/dbmigrations.go') diff --git a/internal/dbmigrations.go b/internal/dbmigrations.go index d5f4836..50badc0 100644 --- a/internal/dbmigrations.go +++ b/internal/dbmigrations.go @@ -8,7 +8,7 @@ import ( "golang.org/x/crypto/bcrypt" ) -func Migrate (db *sql.DB, webmaster string, passOne string, passTwo string) { +func Migrate(db *sql.DB, webmaster string, passOne string, passTwo string) { _, table_check := db.Query("SELECT * FROM logins;") if table_check != nil { _, err := db.Exec("CREATE TABLE logins (id SERIAL PRIMARY KEY, name VARCHAR(50) NOT NULL, time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, pass_one TEXT NOT NULL, pass_two TEXT NOT NULL);") @@ -40,7 +40,6 @@ func Migrate (db *sql.DB, webmaster string, passOne string, passTwo string) { } } - _, table_check = db.Query("SELECT * FROM cookies;") if table_check != nil { _, err := db.Exec("CREATE TABLE cookies (id SERIAL PRIMARY KEY, content VARCHAR(255) NOT NULL, user_id INTEGER REFERENCES logins(id), expiration TIMESTAMP);") -- cgit v1.2.3