mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fa3f1b6e41
* add code to repopulate model config records after schema update * reformat for ruff * migrate model records using db cursor rather than the ModelRecordConfigService * ruff fixes * tweak exception reporting * fix: build frontend in pypi-release workflow This was missing, resulting in the 3.5.0rc1 having no frontend. * fix: use node 18, set working directory - Node 20 has a problem with `pnpm`; set it to Node 18 - Set the working directory for the frontend commands * Don't copy extraneous paths into installer .zip * feat(installer): delete frontend build after creating installer This prevents an empty `dist/` from breaking the app on startup. * feat: add python dist as release artifact, as input to enable publish to pypi - The release workflow never runs automatically. It must be manually kicked off. - The release workflow has an input. When running it from the GH actions UI, you will see a "Publish build on PyPi" prompt. If this value is "true", the workflow will upload the build to PyPi, releasing it. If this is anything else (e.g. "false", the default), the workflow will build but not upload to PyPi. - The `dist/` folder (where the python package is built) is uploaded as a workflow artifact as a zip file. This can be downloaded and inspected. This allows "dry" runs of the workflow. - The workflow job and some steps have been renamed to clarify what they do * translationBot(ui): update translation files Updated by "Cleanup translation files" hook in Weblate. Co-authored-by: Hosted Weblate <hosted@weblate.org> Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/ Translation: InvokeAI/Web UI * freeze yaml migration logic at upgrade to 3.5 * moved migration code to migration_3 --------- Co-authored-by: Lincoln Stein <lstein@gmail.com> Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Co-authored-by: Hosted Weblate <hosted@weblate.org>
35 lines
1.5 KiB
Python
35 lines
1.5 KiB
Python
from logging import Logger
|
|
|
|
from invokeai.app.services.config.config_default import InvokeAIAppConfig
|
|
from invokeai.app.services.image_files.image_files_base import ImageFileStorageBase
|
|
from invokeai.app.services.shared.sqlite.sqlite_database import SqliteDatabase
|
|
from invokeai.app.services.shared.sqlite_migrator.migrations.migration_1 import build_migration_1
|
|
from invokeai.app.services.shared.sqlite_migrator.migrations.migration_2 import build_migration_2
|
|
from invokeai.app.services.shared.sqlite_migrator.migrations.migration_3 import build_migration_3
|
|
from invokeai.app.services.shared.sqlite_migrator.sqlite_migrator_impl import SqliteMigrator
|
|
|
|
|
|
def init_db(config: InvokeAIAppConfig, logger: Logger, image_files: ImageFileStorageBase) -> SqliteDatabase:
|
|
"""
|
|
Initializes the SQLite database.
|
|
|
|
:param config: The app config
|
|
:param logger: The logger
|
|
:param image_files: The image files service (used by migration 2)
|
|
|
|
This function:
|
|
- Instantiates a :class:`SqliteDatabase`
|
|
- Instantiates a :class:`SqliteMigrator` and registers all migrations
|
|
- Runs all migrations
|
|
"""
|
|
db_path = None if config.use_memory_db else config.db_path
|
|
db = SqliteDatabase(db_path=db_path, logger=logger, verbose=config.log_sql)
|
|
|
|
migrator = SqliteMigrator(db=db)
|
|
migrator.register_migration(build_migration_1())
|
|
migrator.register_migration(build_migration_2(image_files=image_files, logger=logger))
|
|
migrator.register_migration(build_migration_3())
|
|
migrator.run_migrations()
|
|
|
|
return db
|