v1.2.0: remove test from gorm
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
8861c369cc
commit
b7e44e85af
1 changed files with 0 additions and 7 deletions
|
|
@ -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{})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue