fix: rename tables failed_event to failed_events (#287)

* fix: rename tables failed_event to failed_events

* fix: use const
This commit is contained in:
Fabi 2020-06-29 09:56:29 +02:00 committed by GitHub
parent 79eff2795f
commit 5a0876cf98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 7 deletions

View File

@ -5,7 +5,8 @@ import (
)
const (
errTable = "admin_api.failed_event"
errTable = "admin_api.failed_events"
errColumn = "failed_events"
)
func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error {
@ -13,7 +14,7 @@ func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error {
}
func (v *View) RemoveFailedEvent(database string, failedEvent *repository.FailedEvent) error {
return repository.RemoveFailedEvent(v.Db, database+".failed_event", failedEvent)
return repository.RemoveFailedEvent(v.Db, database+"."+errColumn, failedEvent)
}
func (v *View) latestFailedEvent(viewName string, sequence uint64) (*repository.FailedEvent, error) {
@ -21,5 +22,5 @@ func (v *View) latestFailedEvent(viewName string, sequence uint64) (*repository.
}
func (v *View) AllFailedEvents(db string) ([]*repository.FailedEvent, error) {
return repository.AllFailedEvents(v.Db, db+".failed_event")
return repository.AllFailedEvents(v.Db, db+"."+errColumn)
}

View File

@ -5,7 +5,7 @@ import (
)
const (
errTable = "auth.failed_event"
errTable = "auth.failed_events"
)
func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error {

View File

@ -5,7 +5,7 @@ import (
)
const (
errTable = "authz.failed_event"
errTable = "authz.failed_events"
)
func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error {

View File

@ -5,7 +5,7 @@ import (
)
const (
errTable = "management.failed_event"
errTable = "management.failed_events"
)
func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error {

View File

@ -5,7 +5,7 @@ import (
)
const (
errTable = "notification.failed_event"
errTable = "notification.failed_events"
)
func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error {

View File

@ -0,0 +1,9 @@
BEGIN;
ALTER TABLE management.failed_event RENAME TO management.failed_events;
ALTER TABLE auth.failed_event RENAME TO auth.failed_events;
ALTER TABLE notification.failed_event RENAME TO notification.failed_events;
ALTER TABLE authz.failed_event RENAME TO authz.failed_events;
ALTER TABLE admin.failed_event RENAME TO admin.failed_events;
COMMIT;