Add password column into database.
This commit is contained in:
parent
7ad214a9ad
commit
e002f32e7e
|
@ -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
|
||||||
|
}}
|
||||||
|
}
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue