refactor(go): simplify realtime mysql current tables
This commit is contained in:
@@ -52,11 +52,14 @@ func TestSnapshotWriterEnsuresSchemaAndUpsertsCoreSnapshot(t *testing.T) {
|
||||
if strings.Contains(call.query, "parsed_json") || strings.Contains(call.query, "fields_json") {
|
||||
t.Fatalf("realtime schema should not contain json payload columns: %s", call.query)
|
||||
}
|
||||
for _, column := range []string{"message_id", "sequence_id", "source_endpoint"} {
|
||||
for _, column := range []string{"id BIGINT", "created_at", "message_id", "sequence_id", "source_endpoint"} {
|
||||
if strings.Contains(call.query, column) {
|
||||
t.Fatalf("realtime schema should not contain %s: %s", column, call.query)
|
||||
}
|
||||
}
|
||||
if !strings.Contains(call.query, "PRIMARY KEY (protocol, vin)") {
|
||||
t.Fatalf("realtime current-state table should key by protocol/vin: %s", call.query)
|
||||
}
|
||||
}
|
||||
upsert := exec.calls[2]
|
||||
if !strings.Contains(upsert.query, "ON DUPLICATE KEY UPDATE") {
|
||||
|
||||
Reference in New Issue
Block a user