From d8a539fc770a98a634118090a3d99a329400821f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:55:53 +0000 Subject: [PATCH 1/2] fix(deps): update google.golang.org/genproto/googleapis/api digest to 9d4c2d2 (#441) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- server/go.mod | 2 +- server/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/go.mod b/server/go.mod index ec019e6e..8cda5784 100644 --- a/server/go.mod +++ b/server/go.mod @@ -25,7 +25,7 @@ require ( github.com/stretchr/testify v1.9.0 github.com/testcontainers/testcontainers-go v0.33.0 golang.org/x/sync v0.8.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 + google.golang.org/genproto/googleapis/api v0.0.0-20240924160255-9d4c2d233b61 google.golang.org/grpc v1.67.0 google.golang.org/protobuf v1.34.3-0.20240906163944-03df6c145d96 gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df diff --git a/server/go.sum b/server/go.sum index 1e4c6051..eeab461e 100644 --- a/server/go.sum +++ b/server/go.sum @@ -579,8 +579,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= +google.golang.org/genproto/googleapis/api v0.0.0-20240924160255-9d4c2d233b61 h1:pAjq8XSSzXoP9ya73v/w+9QEAAJNluLrpmMq5qFJQNY= +google.golang.org/genproto/googleapis/api v0.0.0-20240924160255-9d4c2d233b61/go.mod h1:O6rP0uBq4k0mdi/b4ZEMAZjkhYWhS815kCvaMha4VN8= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= From e752e0ad106c830b71d2568262e249a88a3f0e24 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Wed, 25 Sep 2024 01:36:51 +0800 Subject: [PATCH 2/2] tested if migrating pointers to structs makes gorm happy --- server/backend/migration/20241023000000.go | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/server/backend/migration/20241023000000.go b/server/backend/migration/20241023000000.go index 2f5c05fb..4ddd66fa 100644 --- a/server/backend/migration/20241023000000.go +++ b/server/backend/migration/20241023000000.go @@ -43,31 +43,19 @@ func migrate20241023000000() *gormigrate.Migration { return &gormigrate.Migration{ ID: "20241023000000", Migrate: func(tx *gorm.DB) error { - if err := tx.Migrator().DropTable(InitialStudentClub{}); err != nil { + if err := tx.Migrator().DropTable(&InitialStudentClub{}, &InitialStudentClubCollection{}); err != nil { return err } - if err := tx.Migrator().DropTable(InitialStudentClubCollection{}); err != nil { - return err - } - if err := tx.Migrator().AutoMigrate(newStudentClubCollection{}); err != nil { - return err - } - if err := tx.Migrator().AutoMigrate(newStudentClub{}); err != nil { + if err := tx.Migrator().AutoMigrate(&newStudentClubCollection{}, &newStudentClub{}); err != nil { return err } return nil }, Rollback: func(tx *gorm.DB) error { - if err := tx.Migrator().DropTable(newStudentClub{}); err != nil { - return err - } - if err := tx.Migrator().DropTable(newStudentClubCollection{}); err != nil { - return err - } - if err := tx.Migrator().AutoMigrate(InitialStudentClubCollection{}); err != nil { + if err := tx.Migrator().DropTable(&newStudentClub{}, &newStudentClubCollection{}); err != nil { return err } - if err := tx.Migrator().AutoMigrate(InitialStudentClub{}); err != nil { + if err := tx.Migrator().AutoMigrate(&InitialStudentClubCollection{}, &InitialStudentClub{}); err != nil { return err } return nil