mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-24 13:01:28 +00:00
29 lines
785 B
Python
29 lines
785 B
Python
from abc import ABC, abstractmethod
|
|
|
|
|
|
class Migration(ABC):
|
|
"""
|
|
Abstract Migration class
|
|
This class is used to define the structure of a migration
|
|
Migration has a function is_migration_needed() that returns True or False
|
|
Migration has a function migrate() that does the migration
|
|
Migration has a function get_migration_name() that returns the migration name
|
|
Migration has a function get_migration_description() that returns the migration description
|
|
"""
|
|
|
|
@abstractmethod
|
|
def get_migration_name(self) -> str:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_migration_description(self) -> str:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def is_migration_needed(self) -> bool:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def migrate(self) -> None:
|
|
pass
|