This commit is contained in:
2024-12-01 15:56:24 +01:00
commit e241319e6e
13 changed files with 525 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package database
import (
"log"
//"time"
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
func Migrate() {
dsn := ""
db, err := gorm.Open(postgres.Open(dsn))
if err != nil {
log.Fatalf("Unable to open database connection: %s", err)
}
db.AutoMigrate(&Message{})
log.Println("Message created")
log.Println("Remember to call create_hypertable on message, sowhat I can't do that for you.")
}