nexusLIMS.cli.migrate#

CLI for NexusLIMS database migrations.

Provides simple commands for common database migration operations, while still allowing advanced users to access the underlying Alembic functionality.

Usage#

.. code-block:: bash

# Initialize a new database
nexuslims db init

# Upgrade to latest schema version
nexuslims db upgrade

# Show current database version
nexuslims db current

# Check for pending migrations
nexuslims db check

# Downgrade one migration
nexuslims db downgrade

# Browse the database interactively
nexuslims db view

# Create a demo database with sample instruments
nexuslims db create-demo [PATH]

# Advanced: Run any Alembic command
nexuslims db alembic history --verbose

Examples:

Set up a new database:

.. code-block:: bash

nexuslims db init

Check database status:

.. code-block:: bash

nexuslims db current
nexuslims db check

Apply pending migrations:

.. code-block:: bash

nexuslims db upgrade

Notes:

This command automatically locates the migrations directory inside the installed package, making it work correctly whether NexusLIMS is installed via pip, uv, or run from source.

Module Contents#

Functions#

main

Entry point for nexuslims db CLI.

API#

nexusLIMS.cli.migrate.main() None[source]#

Entry point for nexuslims db CLI.