mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 07:57:32 +00:00
chore: move the go code into a subfolder
This commit is contained in:
34
apps/api/cmd/setup/16.go
Normal file
34
apps/api/cmd/setup/16.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package setup
|
||||
|
||||
import (
|
||||
"context"
|
||||
_ "embed"
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/database"
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed 16.sql
|
||||
uniqueConstraintLower string
|
||||
)
|
||||
|
||||
type UniqueConstraintToLower struct {
|
||||
dbClient *database.DB
|
||||
}
|
||||
|
||||
func (mig *UniqueConstraintToLower) Execute(ctx context.Context, _ eventstore.Event) error {
|
||||
res, err := mig.dbClient.ExecContext(ctx, uniqueConstraintLower)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
count, err := res.RowsAffected()
|
||||
logging.WithFields("count", count).Info("unique constraints updated")
|
||||
return err
|
||||
}
|
||||
|
||||
func (mig *UniqueConstraintToLower) String() string {
|
||||
return "16_unique_constraint_lower"
|
||||
}
|
Reference in New Issue
Block a user