mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
fix: merge migrations (#363)
* fix: merge migrations * fix: rename env variable
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/caos/zitadel/internal/view/repository"
|
||||
)
|
||||
|
||||
var dbList = []string{"management", "auth", "authz", "admin_api", "notification"}
|
||||
var dbList = []string{"management", "auth", "authz", "adminapi", "notification"}
|
||||
|
||||
type AdministratorRepo struct {
|
||||
View *view.View
|
||||
|
@@ -21,7 +21,7 @@ type IamMember struct {
|
||||
}
|
||||
|
||||
const (
|
||||
iamMemberTable = "admin_api.iam_members"
|
||||
iamMemberTable = "adminapi.iam_members"
|
||||
)
|
||||
|
||||
func (m *IamMember) MinimumCycleDuration() time.Duration { return m.cycleDuration }
|
||||
|
@@ -16,7 +16,7 @@ type Org struct {
|
||||
}
|
||||
|
||||
const (
|
||||
orgTable = "admin_api.orgs"
|
||||
orgTable = "adminapi.orgs"
|
||||
)
|
||||
|
||||
func (o *Org) MinimumCycleDuration() time.Duration { return o.cycleDuration }
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
lockTable = "admin_api.locks"
|
||||
lockTable = "adminapi.locks"
|
||||
lockedUntilKey = "locked_until"
|
||||
lockerIDKey = "locker_id"
|
||||
objectTypeKey = "object_type"
|
||||
|
@@ -57,7 +57,7 @@ func (db *dbMock) expectReleaseSavepoint() *dbMock {
|
||||
|
||||
func (db *dbMock) expectRenew(lockerID, view string, affectedRows int64) *dbMock {
|
||||
query := db.mock.
|
||||
ExpectExec(`INSERT INTO admin_api\.locks \(object_type, locker_id, locked_until\) VALUES \(\$1, \$2, now\(\)\+\$3\) ON CONFLICT \(object_type\) DO UPDATE SET locked_until = now\(\)\+\$4, locker_id = \$5 WHERE \(locks\.locked_until < now\(\) OR locks\.locker_id = \$6\) AND locks\.object_type = \$7`).
|
||||
ExpectExec(`INSERT INTO adminapi\.locks \(object_type, locker_id, locked_until\) VALUES \(\$1, \$2, now\(\)\+\$3\) ON CONFLICT \(object_type\) DO UPDATE SET locked_until = now\(\)\+\$4, locker_id = \$5 WHERE \(locks\.locked_until < now\(\) OR locks\.locker_id = \$6\) AND locks\.object_type = \$7`).
|
||||
WithArgs(view, lockerID, sqlmock.AnyArg(), sqlmock.AnyArg(), lockerID, lockerID, view).
|
||||
WillReturnResult(sqlmock.NewResult(1, 1))
|
||||
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
errTable = "admin_api.failed_events"
|
||||
errTable = "adminapi.failed_events"
|
||||
errColumn = "failed_events"
|
||||
)
|
||||
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
iamMemberTable = "admin_api.iam_members"
|
||||
iamMemberTable = "adminapi.iam_members"
|
||||
)
|
||||
|
||||
func (v *View) IamMemberByIDs(orgID, userID string) (*model.IamMemberView, error) {
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
orgTable = "admin_api.orgs"
|
||||
orgTable = "adminapi.orgs"
|
||||
)
|
||||
|
||||
func (v *View) OrgByID(orgID string) (*model.OrgView, error) {
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
sequencesTable = "admin_api.current_sequences"
|
||||
sequencesTable = "adminapi.current_sequences"
|
||||
)
|
||||
|
||||
func (v *View) saveCurrentSequence(viewName string, sequence uint64) error {
|
||||
|
Reference in New Issue
Block a user