diff --git a/internal/admin/repository/eventsourcing/view/error_event.go b/internal/admin/repository/eventsourcing/view/error_event.go index 7d2928e5dd..c509425f99 100644 --- a/internal/admin/repository/eventsourcing/view/error_event.go +++ b/internal/admin/repository/eventsourcing/view/error_event.go @@ -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) } diff --git a/internal/auth/repository/eventsourcing/view/error_event.go b/internal/auth/repository/eventsourcing/view/error_event.go index 81ea49081b..d1c322ca6f 100644 --- a/internal/auth/repository/eventsourcing/view/error_event.go +++ b/internal/auth/repository/eventsourcing/view/error_event.go @@ -5,7 +5,7 @@ import ( ) const ( - errTable = "auth.failed_event" + errTable = "auth.failed_events" ) func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error { diff --git a/internal/authz/repository/eventsourcing/view/error_event.go b/internal/authz/repository/eventsourcing/view/error_event.go index 9b707b0004..6f8488dd54 100644 --- a/internal/authz/repository/eventsourcing/view/error_event.go +++ b/internal/authz/repository/eventsourcing/view/error_event.go @@ -5,7 +5,7 @@ import ( ) const ( - errTable = "authz.failed_event" + errTable = "authz.failed_events" ) func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error { diff --git a/internal/management/repository/eventsourcing/view/error_event.go b/internal/management/repository/eventsourcing/view/error_event.go index 80dbf2902e..50440dc164 100644 --- a/internal/management/repository/eventsourcing/view/error_event.go +++ b/internal/management/repository/eventsourcing/view/error_event.go @@ -5,7 +5,7 @@ import ( ) const ( - errTable = "management.failed_event" + errTable = "management.failed_events" ) func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error { diff --git a/internal/notification/repository/eventsourcing/view/error_event.go b/internal/notification/repository/eventsourcing/view/error_event.go index 3c65c2d61f..8979826576 100644 --- a/internal/notification/repository/eventsourcing/view/error_event.go +++ b/internal/notification/repository/eventsourcing/view/error_event.go @@ -5,7 +5,7 @@ import ( ) const ( - errTable = "notification.failed_event" + errTable = "notification.failed_events" ) func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error { diff --git a/migrations/cockroach/V1.24__failed_events.sql b/migrations/cockroach/V1.24__failed_events.sql new file mode 100644 index 0000000000..beb150da1e --- /dev/null +++ b/migrations/cockroach/V1.24__failed_events.sql @@ -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;