Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/.env
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ TURNSTILE_SECRET_KEY=1x0000000000000000000000000000000AA

# League
CURRENT_SOFTCORE_LEAGUE="Mirage"
ALL_SOFTCORE_LEAGUES="Mirage|Keepers|Mercenaries|Phrecia"

LEAGUE_LAUNCH_TIME=2026-03-06T19:00:00Z # ISO 8601 format. Round backwards to whole hour number

Expand Down
18 changes: 8 additions & 10 deletions src/backend_api/app/alembic/replaceable_objects/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def __init__(self, name, sqltext):


class ReplaceableTrigger(ReplaceableObject):
def __init__(self, name: str, table: str, function: str, trigger: str):
def __init__(self, name, table, function, trigger):
self.name = name
self.table = table
self.function = function.format(name=name)
self.trigger = trigger.format(name=name, table=table)
self.function = function
self.trigger = trigger


ObjectType = TypeVar("ObjectType", bound=ReplaceableObject)
Expand Down Expand Up @@ -89,24 +89,22 @@ def reverse(self):
@Operations.implementation_for(CreateViewOp)
def create_view(operations: Operations, operation: CreateViewOp):
operations.execute(
"CREATE VIEW {} AS {}".format(operation.target.name, operation.target.sqltext)
"CREATE VIEW %s AS %s" % (operation.target.name, operation.target.sqltext)
)


@Operations.implementation_for(DropViewOp)
def drop_view(operations: Operations, operation: DropViewOp):
operations.execute("DROP VIEW {}".format(operation.target.name))
operations.execute("DROP VIEW %s" % operation.target.name)


@Operations.implementation_for(CreateTriggerOp)
def create_trigger(operations: Operations, operation: CreateTriggerOp):
operations.execute(
"CREATE FUNCTION {}() {}".format(
operation.target.name, operation.target.function
)
"CREATE FUNCTION %s() %s" % (operation.target.name, operation.target.function)
)
operations.execute(
"CREATE TRIGGER {} {}".format(operation.target.name, operation.target.trigger)
"CREATE TRIGGER %s %s" % (operation.target.name, operation.target.trigger)
)


Expand All @@ -115,4 +113,4 @@ def drop_trigger(operations: Operations, operation: DropTriggerOp):
operations.execute(
"DROP TRIGGER {} ON {};".format(operation.target.name, operation.target.table)
)
operations.execute("DROP FUNCTION {}();".format(operation.target.name))
operations.execute("DROP FUNCTION %s();" % operation.target.name)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from app.alembic.replaceable_objects.main import ReplaceableTrigger


# revision identifiers, used by Alembic.
revision: str = "e38727349f3f"
down_revision: Union[str, None] = "0f3f15f56b7d"
Expand All @@ -24,7 +25,7 @@
"aggregate_unidentified",
"unidentified_item",
"""
RETURNS TRIGGER AS ${name}$
RETURNS TRIGGER AS $aggregate_unidentified$
DECLARE
current_hour INT;
divine_id INT;
Expand Down Expand Up @@ -64,12 +65,12 @@

RETURN NEW;
END;
${name}$ LANGUAGE plpgsql;
$aggregate_unidentified$ LANGUAGE plpgsql;
""",
"""
BEFORE INSERT ON {table}
BEFORE INSERT ON unidentified_item
FOR EACH ROW
EXECUTE FUNCTION {name}();
EXECUTE FUNCTION aggregate_unidentified();
""",
)

Expand Down
4 changes: 2 additions & 2 deletions src/backend_api/app/api/routes/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def create_currency(


@router.put(
"/",
"/{currencyId}",
response_model=schemas.Currency,
dependencies=[
Depends(get_current_active_superuser),
Expand All @@ -162,7 +162,7 @@ async def update_currency(


@router.delete(
"/",
"/{currencyId}",
response_model=str,
dependencies=[
Depends(get_current_active_superuser),
Expand Down
4 changes: 2 additions & 2 deletions src/backend_api/app/api/routes/item_base_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async def create_item_base_type(


@router.put(
"/",
"/{itemBaseTypeId}",
response_model=schemas.ItemBaseType,
dependencies=[
Depends(get_current_active_superuser),
Expand Down Expand Up @@ -141,7 +141,7 @@ async def update_item_base_type(


@router.delete(
"/",
"/{itemBaseTypeId}",
response_model=str,
dependencies=[Depends(get_current_active_superuser)],
)
Expand Down
6 changes: 2 additions & 4 deletions src/backend_api/app/api/routes/modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ async def create_modifier(
)
async def update_modifier(
modifierId: int,
position: int,
modifier_update: schemas.ModifierUpdate,
db: Session = Depends(get_db),
):
Expand All @@ -156,7 +155,7 @@ async def update_modifier(
Returns the updated modifier.
"""

modifier_map = {"modifierId": modifierId, "position": position}
modifier_map = {"modifierId": modifierId}

modifier = await CRUD_modifier.get(
db=db,
Expand All @@ -173,7 +172,6 @@ async def update_modifier(
)
async def delete_modifier(
modifierId: int,
position: int,
db: Session = Depends(get_db),
):
"""
Expand All @@ -183,7 +181,7 @@ async def delete_modifier(
Always deletes one modifier.
"""

modifier_map = {"modifierId": modifierId, "position": position}
modifier_map = {"modifierId": modifierId}
await CRUD_modifier.remove(db=db, filter=modifier_map)

return get_delete_return_msg(
Expand Down
Loading
Loading