aboutsummaryrefslogtreecommitdiff
path: root/internal/dbmigrations.go
diff options
context:
space:
mode:
authorSamuel Johnson <[email protected]>2025-11-26 00:58:34 -0500
committerSamuel Johnson <[email protected]>2025-11-26 00:58:34 -0500
commitc72dfab37fd6f0d739ea70d42779b2a8c85e9915 (patch)
tree365fd790550a395daa762f746d6d82b2d1cfbd00 /internal/dbmigrations.go
parent350170e0f2a2d26a79924d24b32468057719cf60 (diff)
Add Youtube RSS parser
Diffstat (limited to 'internal/dbmigrations.go')
-rw-r--r--internal/dbmigrations.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/dbmigrations.go b/internal/dbmigrations.go
index 50badc0..7d520ba 100644
--- a/internal/dbmigrations.go
+++ b/internal/dbmigrations.go
@@ -40,6 +40,15 @@ func Migrate(db *sql.DB, webmaster string, passOne string, passTwo string) {
}
}
+ _, table_check = db.Query("SELECT * FROM feeds;")
+ if table_check != nil {
+ _, err := db.Exec("CREATE TABLE feeds (id SERIAL PRIMARY KEY, name VARCHAR(50) NOT NULL, user_id INTEGER REFERENCES logins(id), url VARCHAR(255) NOT NULL);")
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "Unable to create feeds table: %v\n", err)
+ os.Exit(1)
+ }
+ }
+
_, 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);")