feat: Update database models and DTOs to use bytea for ULIDWrapper and add JWT configuration to environment

This commit is contained in:
2025-03-11 23:11:49 +00:00
parent c08da6fc92
commit 9057adebdd
19 changed files with 315 additions and 327 deletions
+17 -1
View File
@@ -2,6 +2,7 @@ package main
import (
"context"
"flag"
"fmt"
"log"
"time"
@@ -10,6 +11,9 @@ import (
)
func main() {
dropTable := flag.String("drop_table", "", "Drop the specified table")
flag.Parse()
// Get database configuration with sensible defaults
dbConfig := models.DefaultDatabaseConfig()
@@ -34,7 +38,19 @@ func main() {
// Test database connection with a simple query
var result int
err := db.Raw("SELECT 1").Scan(&result).Error
var err error
if *dropTable != "" {
fmt.Printf("Dropping table %s...\n", *dropTable)
dropErr := db.Exec(fmt.Sprintf("DROP TABLE IF EXISTS %s", *dropTable)).Error
if dropErr != nil {
log.Fatalf("Error dropping table %s: %v", *dropTable, dropErr)
}
fmt.Printf("✓ Table %s dropped successfully\n", *dropTable)
return
}
err = db.Raw("SELECT 1").Scan(&result).Error
if err != nil {
log.Fatalf("Error executing test query: %v", err)
}