Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

948 B
Raw Blame
import sqlite3

from invokeai.app.services.shared.sqlite_migrator.sqlite_migrator_common import Migration


class Migration16Callback:
    def __call__(self, cursor: sqlite3.Cursor) -> None:
        self._add_retried_from_item_id_col(cursor)

    def _add_retried_from_item_id_col(self, cursor: sqlite3.Cursor) -> None:
        """
        - Adds `retried_from_item_id` column to the session queue table.
        """

        cursor.execute("ALTER TABLE session_queue ADD COLUMN retried_from_item_id INTEGER;")


def build_migration_16() -> Migration:
    """
    Build the migration from database version 15 to 16.

    This migration does the following:
        - Adds `retried_from_item_id` column to the session queue table.
    """
    migration_16 = Migration(
        id="migration_16",
        depends_on="migration_15",
        from_version=15,
        to_version=16,
        callback=Migration16Callback(),
    )

    return migration_16