- 313 new markdown files created - 30 relationships embedded - 313 entries indexed - State initialized with usage data
712 B
712 B
| id | type | title | tags | importance | confidence | created | updated | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 478cd8a2-efb4-47c2-a215-dcb95f486cf7 | solution | PostgreSQL migration: Add default ORDER BY id to BaseModel.select() |
|
0.9 | 0.8 | 2026-01-31T22:06:36.571809+00:00 | 2026-01-31T22:06:36.571809+00:00 |
PostgreSQL does not guarantee row order without ORDER BY, unlike SQLite which implicitly returned rows by rowid. This caused bugs like get_team_by_owner returning the wrong team. Solution: Override select() in BaseModel to add default .order_by(cls.id). Explicit .order_by() calls will override this default. Tested with joins, where, limit, aggregations - all work correctly.