Skip to content

Commit b28c0d7

Browse files
committed
db: Save db file to module root path
1 parent bce8759 commit b28c0d7

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ vendor
66
.diff_*
77
.git_*
88

9-
*.db
10-
119
*.log

db/sqlite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var DB *gorm.DB
1515
func Open() error {
1616
var err error
1717

18-
DB, err = gorm.Open(sqlite.Open(common.ModuleName+".db"), &gorm.Config{})
18+
DB, err = gorm.Open(sqlite.Open(common.RootPath+"/"+common.ModuleName+".db"), &gorm.Config{})
1919
if err != nil {
2020
logger.Panicln(logger.ERROR, true, err)
2121
}

0 commit comments

Comments
 (0)