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
|
package logins
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"gorm.io/driver/postgres"
|
"gorm.io/driver/postgres"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
@ -13,16 +11,11 @@ type Users struct {
|
||||||
Password string `gorm:""`
|
Password string `gorm:""`
|
||||||
}
|
}
|
||||||
|
|
||||||
func test(tx *gorm.DB) *gorm.DB {
|
|
||||||
return tx.Table("users")
|
|
||||||
}
|
|
||||||
|
|
||||||
func Init_database() {
|
func Init_database() {
|
||||||
dsn := "postgres://acc:totor@postgres:5432/accounts?sslmode=disable"
|
dsn := "postgres://acc:totor@postgres:5432/accounts?sslmode=disable"
|
||||||
db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
|
db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("failed to connect database")
|
|
||||||
}
|
}
|
||||||
fmt.Println(test(db))
|
|
||||||
db.AutoMigrate(&Users{})
|
db.AutoMigrate(&Users{})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue