v1.2.0: remove test from gorm

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2024-03-31 00:03:46 +01:00
commit b7e44e85af
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632

View file

@ -1,8 +1,6 @@
package logins
import (
"fmt"
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
@ -13,16 +11,11 @@ type Users struct {
Password string `gorm:""`
}
func test(tx *gorm.DB) *gorm.DB {
return tx.Table("users")
}
func Init_database() {
dsn := "postgres://acc:totor@postgres:5432/accounts?sslmode=disable"
db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
if err != nil {
panic("failed to connect database")
}
fmt.Println(test(db))
db.AutoMigrate(&Users{})
}