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.

878 B
Raw Blame
import sqlite3

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


class Migration13Callback:
    def __call__(self, cursor: sqlite3.Cursor) -> None:
        self._add_archived_col(cursor)

    def _add_archived_col(self, cursor: sqlite3.Cursor) -> None:
        """
        - Adds `archived` columns to the board table.
        """

        cursor.execute("ALTER TABLE boards ADD COLUMN archived BOOLEAN DEFAULT FALSE;")


def build_migration_13() -> Migration:
    """
    Build the migration from database version 12 to 13..

    This migration does the following:
    - Adds `archived` columns to the board table.
    """
    migration_13 = Migration(
        id="migration_13",
        depends_on="migration_12",
        from_version=12,
        to_version=13,
        callback=Migration13Callback(),
    )

    return migration_13