from core.logger import DBLogger
from core.database.abc.data_access_object_abc import DataAccessObjectABC
from data.schemas.system.executed_migration import ExecutedMigration

logger = DBLogger(__name__)


class ExecutedMigrationDao(DataAccessObjectABC[ExecutedMigration]):

    def __init__(self):
        DataAccessObjectABC.__init__(
            self, __name__, ExecutedMigration, "system._executed_migrations"
        )

        self.attribute(ExecutedMigration.migration_id, str, primary_key=True)


executedMigrationDao = ExecutedMigrationDao()
