first docker container version
This commit is contained in:
@@ -22,8 +22,8 @@ func init() {
|
||||
DB.MustExec("PRAGMA foreign_keys = ON")
|
||||
|
||||
// create the tables if they don't exist
|
||||
if dbSetupInstructions, err := os.ReadFile("setup.sql"); err != nil {
|
||||
panic("can't read database-setup")
|
||||
if dbSetupInstructions, err := os.ReadFile("tables.sql"); err != nil {
|
||||
panic("can't read database-tables-setup")
|
||||
} else {
|
||||
DB.MustExec(string(dbSetupInstructions))
|
||||
|
||||
|
||||
@@ -60,6 +60,13 @@ func setup() {
|
||||
// create a jwt-signature
|
||||
config.ClientSession.JwtSignature = createPassword(100)
|
||||
|
||||
// setp the database
|
||||
if dbSetupInstructions, err := os.ReadFile("setup.sql"); err != nil {
|
||||
panic("can't read database-setup")
|
||||
} else {
|
||||
DB.MustExec(string(dbSetupInstructions))
|
||||
}
|
||||
|
||||
// write the modified config-file
|
||||
WriteConfig()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user