Browse Source

Added two columns to user table, email_verified and theme, no used right now but will probably shortly

Torkel Ödegaard 11 years ago
parent
commit
0140a00884
2 changed files with 20 additions and 9 deletions
  1. 11 9
      pkg/models/user.go
  2. 9 0
      pkg/services/sqlstore/migrations.go

+ 11 - 9
pkg/models/user.go

@@ -11,15 +11,17 @@ var (
 )
 
 type User struct {
-	Id       int64
-	Version  int
-	Email    string
-	Name     string
-	Login    string
-	Password string
-	Salt     string
-	Rands    string
-	Company  string
+	Id            int64
+	Version       int
+	Email         string
+	Name          string
+	Login         string
+	Password      string
+	Salt          string
+	Rands         string
+	Company       string
+	EmailVerified bool
+	Theme         string
 
 	IsAdmin   bool
 	AccountId int64

+ 9 - 0
pkg/services/sqlstore/migrations.go

@@ -47,6 +47,15 @@ func addUserMigrations(mg *Migrator) {
 		&Column{Name: "updated", Type: DB_DateTime, Nullable: false},
 	))
 
+	mg.AddMigration("Add email_verified flag", new(AddColumnMigration).
+		Table("user").Column(&Column{Name: "email_verified", Type: DB_Bool, Nullable: true}))
+
+	mg.AddMigration("Add email_verified flag", new(AddColumnMigration).
+		Table("user").Column(&Column{Name: "email_verified", Type: DB_Bool, Nullable: true}))
+
+	mg.AddMigration("Add user.theme column", new(AddColumnMigration).
+		Table("user").Column(&Column{Name: "theme", Type: DB_Varchar, Nullable: true, Length: 20}))
+
 	//-------  user table indexes ------------------
 	mg.AddMigration("add unique index user.login", new(AddIndexMigration).
 		Table("user").Columns("login").Unique())