feat: add unique constraints for custom subdomain and domain per platform
Some checks failed
Some checks failed
Add UNIQUE(custom_subdomain, platform_id) on store_platforms to prevent two stores from claiming the same subdomain on the same platform. Add UNIQUE(store_id, platform_id) on store_domains to enforce one custom domain per store per platform. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -152,6 +152,12 @@ class StorePlatform(Base, TimestampMixin):
|
||||
"platform_id",
|
||||
name="uq_store_platform",
|
||||
),
|
||||
# Same custom_subdomain cannot be claimed twice on the same platform
|
||||
UniqueConstraint(
|
||||
"custom_subdomain",
|
||||
"platform_id",
|
||||
name="uq_custom_subdomain_platform",
|
||||
),
|
||||
# Performance indexes
|
||||
Index(
|
||||
"idx_store_platform_active",
|
||||
|
||||
Reference in New Issue
Block a user