fix: projection version of restrictions (#7028)

This commit is contained in:
Livio Spring 2023-12-06 12:30:56 +02:00 committed by GitHub
parent ec03340b67
commit 970c062307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -12,7 +12,7 @@ import (
)
const (
RestrictionsProjectionTable = "projections.restrictions"
RestrictionsProjectionTable = "projections.restrictions2"
RestrictionsColumnAggregateID = "aggregate_id"
RestrictionsColumnCreationDate = "creation_date"

View File

@ -35,7 +35,7 @@ func TestRestrictionsProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "INSERT INTO projections.restrictions (instance_id, resource_owner, creation_date, change_date, sequence, aggregate_id, disallow_public_org_registration) VALUES ($1, $2, $3, $4, $5, $6, $7) ON CONFLICT (instance_id, resource_owner) DO UPDATE SET (creation_date, change_date, sequence, aggregate_id, disallow_public_org_registration) = (projections.restrictions.creation_date, EXCLUDED.change_date, EXCLUDED.sequence, EXCLUDED.aggregate_id, EXCLUDED.disallow_public_org_registration)",
expectedStmt: "INSERT INTO projections.restrictions2 (instance_id, resource_owner, creation_date, change_date, sequence, aggregate_id, disallow_public_org_registration) VALUES ($1, $2, $3, $4, $5, $6, $7) ON CONFLICT (instance_id, resource_owner) DO UPDATE SET (creation_date, change_date, sequence, aggregate_id, disallow_public_org_registration) = (projections.restrictions2.creation_date, EXCLUDED.change_date, EXCLUDED.sequence, EXCLUDED.aggregate_id, EXCLUDED.disallow_public_org_registration)",
expectedArgs: []interface{}{
"instance-id",
"ro-id",
@ -66,7 +66,7 @@ func TestRestrictionsProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "INSERT INTO projections.restrictions (instance_id, resource_owner, creation_date, change_date, sequence, aggregate_id) VALUES ($1, $2, $3, $4, $5, $6) ON CONFLICT (instance_id, resource_owner) DO UPDATE SET (creation_date, change_date, sequence, aggregate_id) = (projections.restrictions.creation_date, EXCLUDED.change_date, EXCLUDED.sequence, EXCLUDED.aggregate_id)",
expectedStmt: "INSERT INTO projections.restrictions2 (instance_id, resource_owner, creation_date, change_date, sequence, aggregate_id) VALUES ($1, $2, $3, $4, $5, $6) ON CONFLICT (instance_id, resource_owner) DO UPDATE SET (creation_date, change_date, sequence, aggregate_id) = (projections.restrictions2.creation_date, EXCLUDED.change_date, EXCLUDED.sequence, EXCLUDED.aggregate_id)",
expectedArgs: []interface{}{
"instance-id",
"ro-id",

View File

@ -14,14 +14,14 @@ import (
)
var (
expectedRestrictionsQuery = regexp.QuoteMeta("SELECT projections.restrictions.aggregate_id," +
" projections.restrictions.creation_date," +
" projections.restrictions.change_date," +
" projections.restrictions.resource_owner," +
" projections.restrictions.sequence," +
" projections.restrictions.disallow_public_org_registration," +
" projections.restrictions.allowed_languages" +
" FROM projections.restrictions" +
expectedRestrictionsQuery = regexp.QuoteMeta("SELECT projections.restrictions2.aggregate_id," +
" projections.restrictions2.creation_date," +
" projections.restrictions2.change_date," +
" projections.restrictions2.resource_owner," +
" projections.restrictions2.sequence," +
" projections.restrictions2.disallow_public_org_registration," +
" projections.restrictions2.allowed_languages" +
" FROM projections.restrictions2" +
" AS OF SYSTEM TIME '-1 ms'",
)