2023-12-14 11:17:35 +00:00
|
|
|
package setup
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
_ "embed"
|
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/database"
|
2024-01-25 16:28:20 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
2023-12-14 11:17:35 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
//go:embed 18.sql
|
|
|
|
addLowerFieldsToLoginNames string
|
|
|
|
)
|
|
|
|
|
|
|
|
type AddLowerFieldsToLoginNames struct {
|
|
|
|
dbClient *database.DB
|
|
|
|
}
|
|
|
|
|
2024-01-25 16:28:20 +00:00
|
|
|
func (mig *AddLowerFieldsToLoginNames) Execute(ctx context.Context, _ eventstore.Event) error {
|
2023-12-14 11:17:35 +00:00
|
|
|
_, err := mig.dbClient.ExecContext(ctx, addLowerFieldsToLoginNames)
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (mig *AddLowerFieldsToLoginNames) String() string {
|
|
|
|
return "18_add_lower_fields_to_login_names"
|
|
|
|
}
|