You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2023/11/16 08:07:42 UTC

(incubator-answer) branch feat/1.2.1/dashboard updated: fix(user): update the length of user avatar field #620

This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch feat/1.2.1/dashboard
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/feat/1.2.1/dashboard by this push:
     new 107316d2 fix(user): update the length of user avatar field #620
107316d2 is described below

commit 107316d2f5755830c5e1d7bb9f3f044b000fc0a6
Author: LinkinStars <li...@foxmail.com>
AuthorDate: Thu Nov 16 16:07:10 2023 +0800

    fix(user): update the length of user avatar field #620
---
 internal/entity/user_entity.go | 2 +-
 internal/migrations/v18.go     | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/internal/entity/user_entity.go b/internal/entity/user_entity.go
index 4508874b..32821864 100644
--- a/internal/entity/user_entity.go
+++ b/internal/entity/user_entity.go
@@ -56,7 +56,7 @@ type User struct {
 	Status         int       `xorm:"not null default 1 INT(11) status"`
 	AuthorityGroup int       `xorm:"not null default 1 INT(11) authority_group"`
 	DisplayName    string    `xorm:"not null default '' VARCHAR(30) display_name"`
-	Avatar         string    `xorm:"not null default '' VARCHAR(255) avatar"`
+	Avatar         string    `xorm:"not null default '' VARCHAR(1024) avatar"`
 	Mobile         string    `xorm:"not null VARCHAR(20) mobile"`
 	Bio            string    `xorm:"not null TEXT bio"`
 	BioHTML        string    `xorm:"not null TEXT bio_html"`
diff --git a/internal/migrations/v18.go b/internal/migrations/v18.go
index b59c3b3e..612001c2 100644
--- a/internal/migrations/v18.go
+++ b/internal/migrations/v18.go
@@ -48,5 +48,9 @@ func addPasswordLoginControl(ctx context.Context, x *xorm.Engine) error {
 			return fmt.Errorf("update site info failed: %w", err)
 		}
 	}
-	return nil
+
+	type User struct {
+		Avatar string `xorm:"not null default '' VARCHAR(1024) avatar"`
+	}
+	return x.Context(ctx).Sync(new(User))
 }