Adjusted env.py file to push app context for migrations.
Added migration docs to README
Fixed directory in alembic file to run migrations from Makefile
Add neighborhood column to locations table in database..py
Run migration (new .py shows in versions folder)
Non-obvious technical information
Migrations can be run with Makefile commands now (see README)
The migration includes some other changes (changing some columns to nullable) that had been made before, but hadn't been included in the migration.
Checklist before requesting a review
[x] pre-commit run --all-files (run before pushing)
[x] pytest if applicable
[x] Link issue
[x] Update relevant documentation if applicable: doc strings, readme, poetry.
HERE IS SOME COMMAND LINE OUTPUT
(new-arrivals-chi-py3.11) root@LAPTOP-RMMEN33V:/mnt/c/Users/fdmol/Desktop/MSCAPP/new-arrivals-chi# make create_revision
alembic --config=./new_arrivals_chi/migrations/alembic.ini revision --autogenerate
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
/mnt/c/Users/fdmol/Desktop/MSCAPP/new-arrivals-chi/new_arrivals_chi/migrations/env.py:120: SAWarning: Cannot correctly sort tables; there are unresolvable cycles between tables "hours, locations, organizations, users", which is usually caused by mutually dependent foreign key constraints. Foreign key constraints involving these tables will not be considered; this warning may raise an error in a future release.
context.run_migrations()
INFO [alembic.ddl.postgresql] Detected sequence named 'services_id_seq' as owned by integer column 'services(id)', assuming SERIAL and omitting
INFO [alembic.ddl.postgresql] Detected sequence named 'service_dates_id_seq' as owned by integer column 'service_dates(id)', assuming SERIAL and omitting
INFO [alembic.ddl.postgresql] Detected sequence named 'languages_id_seq' as owned by integer column 'languages(id)', assuming SERIAL and omitting
INFO [alembic.autogenerate.compare] Detected NULL on column 'hours.created_by'
INFO [alembic.autogenerate.compare] Detected NULL on column 'languages.created_by'
INFO [alembic.autogenerate.compare] Detected added column 'locations.neighborhood'
INFO [alembic.autogenerate.compare] Detected NULL on column 'locations.created_by'
INFO [alembic.autogenerate.compare] Detected type change from VARCHAR(length=255) to String(length=260) on 'organizations.name'
INFO [alembic.autogenerate.compare] Detected NULL on column 'organizations.location_id'
INFO [alembic.autogenerate.compare] Detected NULL on column 'organizations.hours_id'
INFO [alembic.autogenerate.compare] Detected NULL on column 'organizations.created_by'
INFO [alembic.autogenerate.compare] Detected NULL on column 'service_dates.created_by'
INFO [alembic.autogenerate.compare] Detected NULL on column 'services.created_by'
Generating /mnt/c/Users/fdmol/Desktop/MSCAPP/new-arrivals-chi/new_arrivals_chi/migrations/versions/2024-05-15-2010_feba3a15cf10_.py ... done
Describe your changes
env.py
file to push app context for migrations.neighborhood
column tolocations
table indatabase..py
Non-obvious technical information
Checklist before requesting a review