apply data migration in the same transaction block with schema migration

This commit is contained in:
2022-04-18 01:19:38 +03:00
parent f806c8918e
commit cdc018ad07
13 changed files with 31 additions and 42 deletions

View File

@ -20,9 +20,5 @@ def test_init(database: SQLite, configuration: Configuration, mocker: MockerFixt
must run migrations on init
"""
migrate_schema_mock = mocker.patch("ahriman.core.database.migrations.Migrations.migrate")
migrate_data_mock = mocker.patch("ahriman.core.database.sqlite.migrate_data")
database.init(configuration)
migrate_schema_mock.assert_called_once_with(pytest.helpers.anyvar(int))
migrate_data_mock.assert_called_once_with(
pytest.helpers.anyvar(int), pytest.helpers.anyvar(int), configuration, configuration.repository_paths)
migrate_schema_mock.assert_called_once_with(pytest.helpers.anyvar(int), configuration)