more
This commit is contained in:
parent
d5e0f7d698
commit
c1fd82bab5
@ -620,13 +620,15 @@ func (self *PostgresDatabase) upgrade7to8() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *PostgresDatabase) upgrade8to9() {
|
func (self *PostgresDatabase) upgrade8to9() {
|
||||||
_, err := self.conn.Exec("ALTER TABLE ArticlePosts ADD COLUMN IF NOT EXISTS frontendpubkey TEXT NOT NULL DEFAULT ''")
|
cmds := []string {
|
||||||
if err != nil {
|
"ALTER TABLE ArticlePosts ADD COLUMN IF NOT EXISTS frontendpubkey TEXT DEFAULT ''",
|
||||||
log.Fatalf(err.Error())
|
"CREATE TABLE IF NOT EXISTS nntpchan_pubkeys(status VARCHAR(16) NOT NULL, pubkey VARCHAR(64) PRIMARY KEY)",
|
||||||
}
|
}
|
||||||
_, err = self.conn.Exec("CREATE TABLE IF NOT EXISTS nntpchan_pubkeys(status VARCHAR(16) NOT NULL, pubkey VARCHAR(64) PRIMARY KEY)")
|
for _, cmd := range cmds {
|
||||||
|
_, err := self.conn.Exec(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf(err.Error())
|
log.Fatalf("%s: %s", cmd, err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.setDBVersion(9)
|
self.setDBVersion(9)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user