File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ package cmd
22
33import (
44 "database/sql"
5- "os"
6- "path/filepath"
75
86 _ "github.com/mattn/go-sqlite3"
97 "github.com/rubenv/sql-migrate"
@@ -156,14 +154,10 @@ var migrations = &migrate.MemoryMigrationSource{
156154}
157155
158156var migrateDatabaseCmd = & cobra.Command {
159- Use : "migrate-database" ,
160- Short : "migrate the database to the newest version supported by this version of the software" ,
157+ Use : "migrate-database" ,
158+ Aliases : []string {"init" },
159+ Short : "migrate the database to the newest version supported by this version of the software" ,
161160 Run : func (cmd * cobra.Command , args []string ) {
162- dbLocation := filepath .Dir (lib .Database )
163- err := os .MkdirAll (dbLocation , 0667 )
164- if err != nil {
165- lib .LogE (err ).Fatal ("Impossible to create the directory for the database" )
166- }
167161 db , err := sql .Open ("sqlite3" , lib .Database )
168162 if err != nil {
169163 lib .LogE (err ).Fatal ("Impossible to open the database." )
Original file line number Diff line number Diff line change 66 _ "github.com/mattn/go-sqlite3"
77)
88
9- var Database = "/var/lib/docker2cvmfs/ docker2cvmfs_archive.sqlite?_foreign_keys=true"
9+ var Database = "docker2cvmfs_archive.sqlite?_foreign_keys=true"
1010
1111var (
1212 BB * sql.DB
You can’t perform that action at this time.
0 commit comments