From d6eab2b586fc05dc4cfd045477dc6e9c87ecd4aa Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 27 Mar 2024 09:27:32 +0100 Subject: [PATCH] models/forgejo_migrations: Gitea tables migration ID Sync() will act on the given struct and the ID field should be exactly as it is in the Gitea migration when a Gitea table is modified. --- models/forgejo_migrations/v1_22/v6.go | 2 +- models/forgejo_migrations/v1_22/v7.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/forgejo_migrations/v1_22/v6.go b/models/forgejo_migrations/v1_22/v6.go index 70feef033d..1a4874872c 100644 --- a/models/forgejo_migrations/v1_22/v6.go +++ b/models/forgejo_migrations/v1_22/v6.go @@ -9,7 +9,7 @@ import ( func AddWikiBranchToRepository(x *xorm.Engine) error { type Repository struct { - ID int64 + ID int64 `xorm:"pk autoincr"` WikiBranch string } diff --git a/models/forgejo_migrations/v1_22/v7.go b/models/forgejo_migrations/v1_22/v7.go index 9e237d2c06..b42dd1af67 100644 --- a/models/forgejo_migrations/v1_22/v7.go +++ b/models/forgejo_migrations/v1_22/v7.go @@ -9,8 +9,8 @@ import ( func AddUserRepoUnitHintsSetting(x *xorm.Engine) error { type User struct { - ID int64 - EnableRepoUnitHints bool `xorm:"NOT NULL DEFAULT true"` + ID int64 `xorm:"pk autoincr"` + EnableRepoUnitHints bool `xorm:"NOT NULL DEFAULT true"` } return x.Sync(&User{})