add database schema migration for bug reports and users tables

This commit is contained in:
Flavio Fois
2026-03-18 13:04:47 +01:00
parent 2fd89881e7
commit 9df575067a
8 changed files with 321 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import (
type Config struct {
Port string
DSN string
Database string
APIKey string
AdminKey string
MaxOpenConns int
@@ -55,9 +56,19 @@ func Load() *Config {
connMaxLifetime = 5
}
dbName := os.Getenv("DATABASE_NAME")
if dbName == "" {
panic("DATABASE_NAME environment variable is required")
}
if os.Getenv("DB_DSN") == "" {
panic("DB_DSN environment variable is required")
}
return &Config{
Port: port,
DSN: os.Getenv("DB_DSN"),
Database: dbName,
APIKey: apiKey,
AdminKey: adminKey,
MaxOpenConns: maxOpenConns,