Fix ineffectual assignments in migrations

pull/474/head
Matt Baer 4 years ago
parent 230c736583
commit 25e4d6448b
  1. 3
      migrations/migrations.go
  2. 3
      migrations/v1.go
  3. 3
      migrations/v2.go
  4. 3
      migrations/v3.go
  5. 3
      migrations/v6.go

@ -87,6 +87,9 @@ func Migrate(db *datastore) error {
var err error var err error
if db.tableExists("appmigrations") { if db.tableExists("appmigrations") {
err = db.QueryRow("SELECT MAX(version) FROM appmigrations").Scan(&version) err = db.QueryRow("SELECT MAX(version) FROM appmigrations").Scan(&version)
if err != nil {
return err
}
} else { } else {
log.Info("Initializing appmigrations table...") log.Info("Initializing appmigrations table...")
version = 0 version = 0

@ -12,6 +12,9 @@ package migrations
func supportUserInvites(db *datastore) error { func supportUserInvites(db *datastore) error {
t, err := db.Begin() t, err := db.Begin()
if err != nil {
return err
}
_, err = t.Exec(`CREATE TABLE userinvites ( _, err = t.Exec(`CREATE TABLE userinvites (
id ` + db.typeChar(6) + ` NOT NULL , id ` + db.typeChar(6) + ` NOT NULL ,
owner_id ` + db.typeInt() + ` NOT NULL , owner_id ` + db.typeInt() + ` NOT NULL ,

@ -12,6 +12,9 @@ package migrations
func supportInstancePages(db *datastore) error { func supportInstancePages(db *datastore) error {
t, err := db.Begin() t, err := db.Begin()
if err != nil {
return err
}
_, err = t.Exec(`ALTER TABLE appcontent ADD COLUMN title ` + db.typeVarChar(255) + db.collateMultiByte() + ` NULL`) _, err = t.Exec(`ALTER TABLE appcontent ADD COLUMN title ` + db.typeVarChar(255) + db.collateMultiByte() + ` NULL`)
if err != nil { if err != nil {

@ -12,6 +12,9 @@ package migrations
func supportUserStatus(db *datastore) error { func supportUserStatus(db *datastore) error {
t, err := db.Begin() t, err := db.Begin()
if err != nil {
return err
}
_, err = t.Exec(`ALTER TABLE users ADD COLUMN status ` + db.typeInt() + ` DEFAULT '0' NOT NULL`) _, err = t.Exec(`ALTER TABLE users ADD COLUMN status ` + db.typeInt() + ` DEFAULT '0' NOT NULL`)
if err != nil { if err != nil {

@ -12,6 +12,9 @@ package migrations
func supportActivityPubMentions(db *datastore) error { func supportActivityPubMentions(db *datastore) error {
t, err := db.Begin() t, err := db.Begin()
if err != nil {
return err
}
_, err = t.Exec(`ALTER TABLE remoteusers ADD COLUMN handle ` + db.typeVarChar(255) + ` NULL`) _, err = t.Exec(`ALTER TABLE remoteusers ADD COLUMN handle ` + db.typeVarChar(255) + ` NULL`)
if err != nil { if err != nil {

Loading…
Cancel
Save