added user independent sections and started db migration work

This commit is contained in:
ston1th 2019-03-26 23:55:55 +01:00
commit 16ea95bf09
24 changed files with 622 additions and 122 deletions

View file

@ -57,9 +57,18 @@ func New(cfg core.Config) (db *DB, err error) {
if err != nil {
return
}
if db.SectionExists(core.WikiSection) != nil {
err = db.CreateSection(core.WikiSection, []string{defUser}, false)
if err != nil {
return
}
}
_, err = db.CreatePage(core.IndexPage, core.WikiSection, welcome, defUser, core.Public)
return
if err != nil {
return
}
return db.RunMigrations()
}
func (db *DB) Dump(w io.Writer) error {