first commit, i i have no idea what i have done

This commit is contained in:
tdv
2025-08-31 22:42:08 +03:00
commit c5632f6a37
177 changed files with 9173 additions and 0 deletions

20
server/internal/db/db.go Normal file
View File

@@ -0,0 +1,20 @@
package db
import (
"gorm.io/driver/postgres"
"gorm.io/gorm"
"smoop-api/internal/models"
)
func Open(dsn string) (*gorm.DB, error) {
return gorm.Open(postgres.Open(dsn), &gorm.Config{})
}
func AutoMigrate(db *gorm.DB) error {
return db.AutoMigrate(
&models.User{},
&models.Device{},
&models.Record{},
)
}