fix: merge migrations (#363)

* fix: merge migrations

* fix: rename env variable
This commit is contained in:
Fabi
2020-07-07 16:53:54 +02:00
committed by GitHub
parent c6e8597eeb
commit 5988ec4844
39 changed files with 672 additions and 828 deletions

View File

@@ -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

View File

@@ -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 }

View File

@@ -16,7 +16,7 @@ type Org struct {
}
const (
orgTable = "admin_api.orgs"
orgTable = "adminapi.orgs"
)
func (o *Org) MinimumCycleDuration() time.Duration { return o.cycleDuration }

View File

@@ -8,7 +8,7 @@ import (
)
const (
lockTable = "admin_api.locks"
lockTable = "adminapi.locks"
lockedUntilKey = "locked_until"
lockerIDKey = "locker_id"
objectTypeKey = "object_type"

View File

@@ -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))

View File

@@ -5,7 +5,7 @@ import (
)
const (
errTable = "admin_api.failed_events"
errTable = "adminapi.failed_events"
errColumn = "failed_events"
)

View File

@@ -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) {

View File

@@ -8,7 +8,7 @@ import (
)
const (
orgTable = "admin_api.orgs"
orgTable = "adminapi.orgs"
)
func (v *View) OrgByID(orgID string) (*model.OrgView, error) {

View File

@@ -5,7 +5,7 @@ import (
)
const (
sequencesTable = "admin_api.current_sequences"
sequencesTable = "adminapi.current_sequences"
)
func (v *View) saveCurrentSequence(viewName string, sequence uint64) error {