lamindb.setup.migrate

class lamindb.setup.migrate

Bases: object

Manage database migrations.

Unless you maintain your own schema modules with your own Django models, you won’t need this.

Examples

Create a migration:

import lamindb as ln

ln.setup.migrate.create()

Deploy a migration:

ln.setup.migrate.deploy()

Check migration consistency:

ln.setup.migrate.check()

See also

Migrate an instance via the CLI, see here.

Class methods

classmethod create(cls)

Create a migration.

Return type:

None

classmethod deploy(package_name=None, number=None)

Deploy a migration.

Return type:

None

classmethod squash(cls, package_name, migration_nr, start_migration_nr=None)

Squash migrations.

Return type:

None

classmethod show(cls)

Show migrations.

Return type:

None

classmethod defined_migrations(latest=False)
classmethod deployed_migrations(latest=False)

Get the list of deployed migrations from Migration table in DB.