MCPcopy Index your code
hub / github.com/reflex-dev/reflex / migrate

Method migrate

reflex/model.py:645–667  ·  view source on GitHub ↗

Execute alembic migrations for all sqlmodel Model classes. If alembic is not installed or has not been initialized for the project, then no action is performed. If there are no revisions currently tracked by alembic, then an initial revision will be

(cls, autogenerate: bool = False)

Source from the content-addressed store, hash-verified

643
644 @classmethod
645 def migrate(cls, autogenerate: bool = False) -> bool | None:
646 """Execute alembic migrations for all sqlmodel Model classes.
647
648 If alembic is not installed or has not been initialized for the project,
649 then no action is performed.
650
651 If there are no revisions currently tracked by alembic, then
652 an initial revision will be created based on sqlmodel metadata.
653
654 If models in the app have changed in incompatible ways that alembic
655 cannot automatically generate revisions for, the app may not be able to
656 start up until migration scripts have been corrected by hand.
657
658 Args:
659 autogenerate: If True, generate migration script and use it to upgrade schema
660 (otherwise, just bring the schema to current "head" revision).
661
662 Returns:
663 True - indicating the process was successful.
664 None - indicating the process was skipped.
665 """
666 _warn_about_model_deprecation()
667 return migrate(autogenerate=autogenerate)
668
669 @classmethod
670 def select(cls):

Callers 2

db_initFunction · 0.80
migrateFunction · 0.80

Calls 2

migrateFunction · 0.70

Tested by

no test coverage detected