2024-01-09 18:36:46 +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"
|
2024-01-09 18:36:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
//go:embed 20.sql
|
|
|
|
addByUserIndexToSession string
|
|
|
|
)
|
|
|
|
|
|
|
|
type AddByUserIndexToSession struct {
|
|
|
|
dbClient *database.DB
|
|
|
|
}
|
|
|
|
|
2024-01-25 16:28:20 +00:00
|
|
|
func (mig *AddByUserIndexToSession) Execute(ctx context.Context, _ eventstore.Event) error {
|
2024-01-09 18:36:46 +00:00
|
|
|
_, err := mig.dbClient.ExecContext(ctx, addByUserIndexToSession)
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (mig *AddByUserIndexToSession) String() string {
|
|
|
|
return "20_add_by_user_index_on_session"
|
|
|
|
}
|