Skip to content

Commit

Permalink
fix: change db dir
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Jul 12, 2024
1 parent 72ea22c commit 9d54307
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"polaris/ent"
"polaris/ent/downloadclients"
"polaris/ent/history"
Expand All @@ -26,7 +27,8 @@ type Client struct {
}

func Open() (*Client, error) {
client, err := ent.Open(dialect.SQLite, "file:polaris.db?cache=shared&_fk=1")
os.Mkdir("./db", 0666)
client, err := ent.Open(dialect.SQLite, "file:./db/polaris.db?cache=shared&_fk=1")
if err != nil {
return nil, errors.Wrap(err, "failed opening connection to sqlite")
}
Expand Down

0 comments on commit 9d54307

Please sign in to comment.