From 0140a00884ace6a0905eff6531d8626a6fad8700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 12 Feb 2015 10:32:22 +0100 Subject: [PATCH] Added two columns to user table, email_verified and theme, no used right now but will probably shortly --- pkg/models/user.go | 20 +++++++++++--------- pkg/services/sqlstore/migrations.go | 9 +++++++++ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/pkg/models/user.go b/pkg/models/user.go index 10ec03791a3..81ed0123c1e 100644 --- a/pkg/models/user.go +++ b/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 diff --git a/pkg/services/sqlstore/migrations.go b/pkg/services/sqlstore/migrations.go index 3f7530d3c70..3c9c27a0918 100644 --- a/pkg/services/sqlstore/migrations.go +++ b/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())