mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-06 13:57:41 +00:00
fix(step10): separate executions (#5754)
* feat: allow skip of success page for native apps (#5627) add possibility to return to callback directly after login without rendering the successful login page * build next * fix(console): disallow inline fonts, critical styles (#5714) fix: disallow inline * fix(setup): step 10 for postgres (#5717) * fix(setup): smaller transactions (#5743) * fix(step10): split statements * fix(step10): split into separate execs * chore: prerelease * add truncate before insert * fix: add truncate * Merge branch 'main' into optimise-step-10 * chore: reset release definition --------- Co-authored-by: Livio Spring <livio.a@gmail.com> Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
parent
5207898f60
commit
86f4477ae1
@ -1,7 +1,6 @@
|
||||
module.exports = {
|
||||
branches: [
|
||||
{name: 'main', channel: 'next'},
|
||||
{name: '1.87.x', range: '1.87.x', channel: '1.87.x'},
|
||||
{name: 'next', prerelease: true}
|
||||
],
|
||||
plugins: [
|
||||
|
@ -13,8 +13,12 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed 10.sql
|
||||
correctCreationDate10 string
|
||||
//go:embed 10_create_temp_table.sql
|
||||
correctCreationDate10CreateTable string
|
||||
//go:embed 10_fill_table.sql
|
||||
correctCreationDate10FillTable string
|
||||
//go:embed 10_update.sql
|
||||
correctCreationDate10Update string
|
||||
)
|
||||
|
||||
type CorrectCreationDate struct {
|
||||
@ -34,7 +38,17 @@ func (mig *CorrectCreationDate) Execute(ctx context.Context) (err error) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
res, err := tx.ExecContext(ctx, correctCreationDate10)
|
||||
_, err := tx.ExecContext(ctx, correctCreationDate10CreateTable)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = tx.ExecContext(ctx, correctCreationDate10FillTable)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
res, err := tx.ExecContext(ctx, correctCreationDate10Update)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
6
cmd/setup/10_create_temp_table.sql
Normal file
6
cmd/setup/10_create_temp_table.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE temporary TABLE IF NOT EXISTS wrong_events (
|
||||
instance_id TEXT
|
||||
, event_sequence BIGINT
|
||||
, current_cd TIMESTAMPTZ
|
||||
, next_cd TIMESTAMPTZ
|
||||
);
|
@ -1,9 +1,4 @@
|
||||
CREATE temporary TABLE IF NOT EXISTS wrong_events (
|
||||
instance_id TEXT
|
||||
, event_sequence BIGINT
|
||||
, current_cd TIMESTAMPTZ
|
||||
, next_cd TIMESTAMPTZ
|
||||
);
|
||||
TRUNCATE wrong_events;
|
||||
|
||||
INSERT INTO wrong_events (
|
||||
SELECT * FROM (
|
||||
@ -22,5 +17,3 @@ INSERT INTO wrong_events (
|
||||
ORDER BY
|
||||
event_sequence DESC
|
||||
);
|
||||
|
||||
UPDATE eventstore.events e SET creation_date = we.next_cd FROM wrong_events we WHERE e.event_sequence = we.event_sequence and e.instance_id = we.instance_id;
|
1
cmd/setup/10_update.sql
Normal file
1
cmd/setup/10_update.sql
Normal file
@ -0,0 +1 @@
|
||||
UPDATE eventstore.events e SET creation_date = we.next_cd FROM wrong_events we WHERE e.event_sequence = we.event_sequence and e.instance_id = we.instance_id;
|
Loading…
x
Reference in New Issue
Block a user