fix: fix and improve primary keys on projections (#3708)

* fix: org_domain projection

* fix: projection reset

* fix test

* improve foreign keys on suffixed tables
This commit is contained in:
Livio Amstutz
2022-05-25 14:15:13 +02:00
committed by GitHub
parent 79452da7d6
commit 737e01bfd2
20 changed files with 403 additions and 156 deletions

View File

@@ -56,9 +56,10 @@ func TestKeyProjection_reduces(t *testing.T) {
},
},
{
expectedStmt: "INSERT INTO projections.keys_private (id, expiry, key) VALUES ($1, $2, $3)",
expectedStmt: "INSERT INTO projections.keys_private (id, instance_id, expiry, key) VALUES ($1, $2, $3, $4)",
expectedArgs: []interface{}{
"agg-id",
"instance-id",
anyArg{},
&crypto.CryptoValue{
CryptoType: crypto.TypeEncryption,
@@ -69,9 +70,10 @@ func TestKeyProjection_reduces(t *testing.T) {
},
},
{
expectedStmt: "INSERT INTO projections.keys_public (id, expiry, key) VALUES ($1, $2, $3)",
expectedStmt: "INSERT INTO projections.keys_public (id, instance_id, expiry, key) VALUES ($1, $2, $3, $4)",
expectedArgs: []interface{}{
"agg-id",
"instance-id",
anyArg{},
[]byte("publicKey"),
},