Add password column into database.

This commit is contained in:
Otto Hollmann 2022-04-02 15:02:33 +02:00
parent 7ad214a9ad
commit e002f32e7e
No known key found for this signature in database
GPG Key ID: 101D022F467ECE22
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,18 @@
package upgrades
import (
"database/sql"
)
func init() {
upgrades[20] = upgrade{"Add password columns to user table.", func(tx *sql.Tx, c context) error {
if c.dialect == Postgres {
_, err := tx.Exec(`ALTER TABLE "user" ADD COLUMN password VARCHAR(255)`)
if err != nil {
return err
}
}
return nil
}}
}

View File

@ -39,7 +39,7 @@ type upgrade struct {
fn upgradeFunc fn upgradeFunc
} }
const NumberOfUpgrades = 20 const NumberOfUpgrades = 21
var upgrades [NumberOfUpgrades]upgrade var upgrades [NumberOfUpgrades]upgrade