feat(complex): add apps.complex with 10 models and full-text search

- 10 models: Complex, ComplexAlias, ComplexBusinessArea, ComplexSchool, ComplexMetroStation, Building, RoomUnit, ComplexPhoto, ComplexAttachment, ComplexPriceTrend
- RunSQL migration: pg_trgm extension, gin_trgm_ops indexes, tsvector triggers for complex search_vector (from name/alias/address)
- Optimistic locking via version field on Complex
- 4 lock flags (lock_building/room/info/standard_room) per spec
- Adds ComplexPropertyUsageType + ComplexBuildingStructure enums
- manage.py check passes

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-29 17:19:01 +08:00
parent 9a7d06b34e
commit c57462f6d1
12 changed files with 909 additions and 0 deletions

View File

@@ -352,6 +352,20 @@ class ComplexPhotoCategory(models.TextChoices):
OTHER = "other", "其他"
class ComplexPropertyUsageType(models.TextChoices):
RESIDENTIAL = "residential", "住宅"
VILLA = "villa", "别墅"
COMMERCIAL_RESIDENTIAL = "commercial_residential", "商住"
COMMERCIAL = "commercial", "商业"
OFFICE = "office", "写字楼"
OTHER = "other", "其他"
class ComplexBuildingStructure(models.TextChoices):
UNIT_ROOM = "unit_room", "单元-房号"
OTHER = "other", "其他"
# ──────────────────────────────────────────────────────────────
# 3.5 property
# ──────────────────────────────────────────────────────────────