Commit c9a7704b authored by Lukas Böhm's avatar Lukas Böhm 🎱
Browse files

fix migrations

parent f2347cab
...@@ -23,3 +23,4 @@ services ...@@ -23,3 +23,4 @@ services
*.htpasswd *.htpasswd
*.env *.env
chiefsend2.conf chiefsend2.conf
api/sqlite:hallo
...@@ -62,8 +62,8 @@ func Reset() { ...@@ -62,8 +62,8 @@ func Reset() {
if err != nil { if err != nil {
log.Fatal("database brok") log.Fatal("database brok")
} }
db.AutoMigrate(&Attachment{})
db.AutoMigrate(&Share{}) db.AutoMigrate(&Share{})
db.AutoMigrate(&Attachment{})
// delete everything // delete everything
db.Where("1 = 1").Delete(&Share{}) db.Where("1 = 1").Delete(&Share{})
db.Where("1 = 1").Delete(&Attachment{}) db.Where("1 = 1").Delete(&Attachment{})
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Shared </title>
</head>
<body>
Hallo test
</body>
</html>
\ No newline at end of file
...@@ -24,8 +24,8 @@ func main() { ...@@ -24,8 +24,8 @@ func main() {
log.Fatal("Cannot connect database") log.Fatal("Cannot connect database")
} }
// Migrate the schema // Migrate the schema
db.AutoMigrate(&Attachment{})
db.AutoMigrate(&Share{}) db.AutoMigrate(&Share{})
db.AutoMigrate(&Attachment{})
// start // start
fmt.Println("Let's go!!!") fmt.Println("Let's go!!!")
ConfigureRoutes() ConfigureRoutes()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment