chore: Remove Server Tasks (#3592)

This commit is contained in:
Michael Genson
2024-05-20 09:51:37 -05:00
committed by GitHub
parent 78d2a3b8aa
commit 61becdbec7
19 changed files with 12 additions and 341 deletions

View File

@@ -15,13 +15,19 @@ from .._model_utils import GUID, auto_init
from ..group.invite_tokens import GroupInviteToken
from ..group.webhooks import GroupWebhooksModel
from ..recipe.category import Category, group_to_categories
from ..server.task import ServerTaskModel
from .cookbook import CookBook
from .mealplan import GroupMealPlan
from .preferences import GroupPreferencesModel
if TYPE_CHECKING:
from ..recipe import IngredientFoodModel, IngredientUnitModel, RecipeModel, Tag, Tool
from ..recipe import (
IngredientFoodModel,
IngredientUnitModel,
RecipeModel,
Tag,
Tool,
)
from ..server.task import ServerTaskModel
from ..users import User
from .events import GroupEventNotifierModel
from .exports import GroupDataExportsModel
@@ -67,7 +73,7 @@ class Group(SqlAlchemyBase, BaseMixins):
webhooks: Mapped[list[GroupWebhooksModel]] = orm.relationship(GroupWebhooksModel, **common_args)
recipe_actions: Mapped[list["GroupRecipeAction"]] = orm.relationship("GroupRecipeAction", **common_args)
cookbooks: Mapped[list[CookBook]] = orm.relationship(CookBook, **common_args)
server_tasks: Mapped[list[ServerTaskModel]] = orm.relationship(ServerTaskModel, **common_args)
server_tasks: Mapped[list["ServerTaskModel"]] = orm.relationship("ServerTaskModel", **common_args)
data_exports: Mapped[list["GroupDataExportsModel"]] = orm.relationship("GroupDataExportsModel", **common_args)
shopping_lists: Mapped[list["ShoppingList"]] = orm.relationship("ShoppingList", **common_args)
group_reports: Mapped[list["ReportModel"]] = orm.relationship("ReportModel", **common_args)

View File

@@ -14,6 +14,8 @@ if TYPE_CHECKING:
class ServerTaskModel(SqlAlchemyBase, BaseMixins):
# Server Tasks are deprecated, but the table still exists in the database
__tablename__ = "server_tasks"
name: Mapped[str] = mapped_column(String, nullable=False)
completed_date: Mapped[datetime] = mapped_column(DateTime, nullable=True)