Skip to content
Snippets Groups Projects
Verified Commit 0c5fdc7f authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

Set current_version attribute to postgresql datastore

Related to T4305
parent 986c672e
No related branches found
Tags v2.0.0
1 merge request!419Set current_version attribute to postgresql datastore
swh.core[db,http] >= 0.14.0
swh.core[db,http] >= 2.9
swh.model >= 0.0.15
swh.objstorage >= 0.2.2
swh.scheduler >= 0.5.2
......
# Copyright (C) 2015-2020 The Software Heritage developers
# Copyright (C) 2015-2022 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
......@@ -120,7 +120,9 @@ def check_id_duplicates(data):
class IndexerStorage:
"""SWH Indexer Storage"""
"""SWH Indexer Storage Datastore"""
current_version = 134
def __init__(self, db, min_pool_conns=1, max_pool_conns=10, journal_writer=None):
"""
......@@ -152,10 +154,6 @@ class IndexerStorage:
if db is not self._db:
db.put_conn()
@db_transaction()
def get_current_version(self, *, db=None, cur=None):
return db.current_version
@timed
@db_transaction()
def check_config(self, *, check_write, db=None, cur=None):
......
# Copyright (C) 2015-2018 The Software Heritage developers
# Copyright (C) 2015-2022 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
......@@ -16,7 +16,6 @@ class Db(BaseDb):
"""Proxy to the SWH Indexer DB, with wrappers around stored procedures"""
content_mimetype_hash_keys = ["id", "indexer_configuration_id"]
current_version = 134
def _missing_from_list(
self, table: str, data: Iterable[Dict], hash_keys: List[str], cur=None
......
......@@ -14,8 +14,7 @@ from pytest_postgresql import factories
import yaml
from swh.core.db.pytest_plugin import initialize_database_for_module
from swh.indexer.storage import get_indexer_storage
from swh.indexer.storage.db import Db as IndexerDb
from swh.indexer.storage import IndexerStorage, get_indexer_storage
from swh.objstorage.factory import get_objstorage
from swh.storage import get_storage
......@@ -33,7 +32,7 @@ idx_postgresql_proc = factories.postgresql_proc(
partial(
initialize_database_for_module,
modname="indexer",
version=IndexerDb.current_version,
version=IndexerStorage.current_version,
)
],
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment