fix: use shared tables for tenant group members
This commit is contained in:
@@ -117,14 +117,14 @@ func TestTenantPartitionTableNames(t *testing.T) {
|
||||
|
||||
func TestTenantShardSQL(t *testing.T) {
|
||||
query := tenantShardSQL(7, "SELECT * FROM im_topics t JOIN im_group_members gm ON gm.topic=t.name JOIN im_subscriptions s ON s.topic=gm.topic; INSERT INTO im_system_notifications(event_id) VALUES(?)")
|
||||
for _, expected := range []string{"im_007_topics", "im_007_group_members", "im_007_subscriptions", "im_007_system_notifications"} {
|
||||
for _, expected := range []string{"im_topics", "im_group_members", "im_subscriptions", "im_system_notifications"} {
|
||||
if !strings.Contains(query, expected) {
|
||||
t.Fatalf("tenant shard query is missing %q: %s", expected, query)
|
||||
t.Fatalf("shared tenant query is missing %q: %s", expected, query)
|
||||
}
|
||||
}
|
||||
for _, legacy := range []string{" im_topics", " im_group_members", " im_subscriptions", " im_system_notifications"} {
|
||||
for _, legacy := range []string{"im_007_topics", "im_007_group_members", "im_007_subscriptions", "im_007_system_notifications"} {
|
||||
if strings.Contains(query, legacy) {
|
||||
t.Fatalf("tenant shard query still references %q: %s", legacy, query)
|
||||
t.Fatalf("shared tenant query should not reference %q: %s", legacy, query)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user