feat: add conversation and conversation_messages tables for concurrent messaging (#8182)
This commit is contained in:
committed by
Caren Thomas
parent
c66b852978
commit
87d920782f
@@ -90,6 +90,36 @@ Workflow for Postgres-targeted migration:
|
||||
- `uv run alembic upgrade head`
|
||||
- `uv run alembic revision --autogenerate -m "..."`
|
||||
|
||||
### 5. Resetting local Postgres for clean migration generation
|
||||
|
||||
If your local Postgres database has drifted from main (e.g., applied migrations
|
||||
that no longer exist, or has stale schema), you can reset it to generate a clean
|
||||
migration.
|
||||
|
||||
From the repo root (`/Users/sarahwooders/repos/letta-cloud`):
|
||||
|
||||
```bash
|
||||
# 1. Remove postgres data directory
|
||||
rm -rf ./data/postgres
|
||||
|
||||
# 2. Stop the running postgres container
|
||||
docker stop $(docker ps -q --filter ancestor=ankane/pgvector)
|
||||
|
||||
# 3. Restart services (creates fresh postgres)
|
||||
just start-services
|
||||
|
||||
# 4. Wait a moment for postgres to be ready, then apply all migrations
|
||||
cd apps/core
|
||||
export LETTA_PG_URI=postgresql+pg8000://postgres:postgres@localhost:5432/letta-core
|
||||
uv run alembic upgrade head
|
||||
|
||||
# 5. Now generate your new migration
|
||||
uv run alembic revision --autogenerate -m "your migration message"
|
||||
```
|
||||
|
||||
This ensures the migration is generated against a clean database state matching
|
||||
main, avoiding spurious diffs from local-only schema changes.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **"Target database is not up to date" when autogenerating**
|
||||
@@ -101,7 +131,7 @@ Workflow for Postgres-targeted migration:
|
||||
changed model is imported in Alembic env context.
|
||||
- **Autogenerated migration has unexpected drops/renames**
|
||||
- Review model changes; consider explicit operations instead of relying on
|
||||
autogenerate.
|
||||
autogenerate. Reset local Postgres (see workflow 5) to get a clean baseline.
|
||||
|
||||
## References
|
||||
|
||||
|
||||
Reference in New Issue
Block a user