db-migrations-and-schema-changes
Workflows and commands for managing Alembic database migrations and schema changes in the letta-cloud core app, including using uv, just, LETTA_PG_URI, and switching between SQLite and Postgres.
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Workflows and commands for managing Alembic database migrations and schema changes in the letta-cloud core app, including using uv, just, LETTA_PG_URI, and switching between SQLite and Postgres.
How to use
Upewnij się, że katalog roboczy to apps/core i uruchom just ready, aby przygotować środowisko i bazę danych.
Jeśli pracujesz z Postgres, ustaw zmienną środowiskową: export LETTA_PG_URI=postgresql+pg8000://postgres:postgres@localhost:5432/letta-core
Dokonaj zmian w modelu SQLAlchemy w katalogu letta/orm/ — na przykład dodaj nową kolumnę lub zmodyfikuj istniejącą. Preferuj używanie mixinów takich jak ProjectMixin zamiast duplikowania kolumn.
Wygeneruj automatycznie nową rewizję migracji za pomocą polecenia: uv run alembic revision --autogenerate -m "krótki opis zmian"
Sprawdź wygenerowany plik w katalogu alembic/versions/ — upewnij się, że operacje op.add_column lub op.alter_column odpowiadają Twoim oczekiwaniom.
Zastosuj migrację do bazy danych poleceniem: uv run alembic upgrade head