From 204dd9e30035cb8f975705cbc1c46862145dccbe Mon Sep 17 00:00:00 2001 From: hazycora Date: Fri, 23 Feb 2024 16:33:02 -0600 Subject: [PATCH] Add migration for pronouns --- models/forgejo_migrations/migrate.go | 2 ++ models/forgejo_migrations/v1_22/v10.go | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 models/forgejo_migrations/v1_22/v10.go diff --git a/models/forgejo_migrations/migrate.go b/models/forgejo_migrations/migrate.go index 965b748ac9..7c295247c0 100644 --- a/models/forgejo_migrations/migrate.go +++ b/models/forgejo_migrations/migrate.go @@ -56,6 +56,8 @@ var migrations = []*Migration{ NewMigration("Modify the `release`.`note` content to remove SSH signatures", forgejo_v1_22.RemoveSSHSignaturesFromReleaseNotes), // v8 -> v9 NewMigration("Add the `apply_to_admins` column to the `protected_branch` table", forgejo_v1_22.AddApplyToAdminsSetting), + // v9 -> v10 + NewMigration("Add pronouns to user", forgejo_v1_22.AddPronounsToUser), } // GetCurrentDBVersion returns the current Forgejo database version. diff --git a/models/forgejo_migrations/v1_22/v10.go b/models/forgejo_migrations/v1_22/v10.go new file mode 100644 index 0000000000..bf1639eeeb --- /dev/null +++ b/models/forgejo_migrations/v1_22/v10.go @@ -0,0 +1,16 @@ +// Copyright 2024 The Forgejo Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +package v1_22 //nolint + +import ( + "xorm.io/xorm" +) + +func AddPronounsToUser(x *xorm.Engine) error { + type User struct { + Pronouns string + } + + return x.Sync(&User{}) +}