Skip to content

Commit 9d9ac8c

Browse files
authored
Merge pull request #822 from Path-of-Modifiers/revert-819-812-make-modifier-id-unique-per-modfier
Revert "812 make modifier id unique per modfier"
2 parents 01f8dc4 + 3de578d commit 9d9ac8c

89 files changed

Lines changed: 576 additions & 928 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ TURNSTILE_SECRET_KEY=1x0000000000000000000000000000000AA
3737

3838
# League
3939
CURRENT_SOFTCORE_LEAGUE="Mirage"
40-
ALL_SOFTCORE_LEAGUES="Mirage|Keepers|Mercenaries|Phrecia"
4140

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

src/backend_api/app/alembic/replaceable_objects/main.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ def __init__(self, name, sqltext):
1212

1313

1414
class ReplaceableTrigger(ReplaceableObject):
15-
def __init__(self, name: str, table: str, function: str, trigger: str):
15+
def __init__(self, name, table, function, trigger):
1616
self.name = name
1717
self.table = table
18-
self.function = function.format(name=name)
19-
self.trigger = trigger.format(name=name, table=table)
18+
self.function = function
19+
self.trigger = trigger
2020

2121

2222
ObjectType = TypeVar("ObjectType", bound=ReplaceableObject)
@@ -89,24 +89,22 @@ def reverse(self):
8989
@Operations.implementation_for(CreateViewOp)
9090
def create_view(operations: Operations, operation: CreateViewOp):
9191
operations.execute(
92-
"CREATE VIEW {} AS {}".format(operation.target.name, operation.target.sqltext)
92+
"CREATE VIEW %s AS %s" % (operation.target.name, operation.target.sqltext)
9393
)
9494

9595

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

100100

101101
@Operations.implementation_for(CreateTriggerOp)
102102
def create_trigger(operations: Operations, operation: CreateTriggerOp):
103103
operations.execute(
104-
"CREATE FUNCTION {}() {}".format(
105-
operation.target.name, operation.target.function
106-
)
104+
"CREATE FUNCTION %s() %s" % (operation.target.name, operation.target.function)
107105
)
108106
operations.execute(
109-
"CREATE TRIGGER {} {}".format(operation.target.name, operation.target.trigger)
107+
"CREATE TRIGGER %s %s" % (operation.target.name, operation.target.trigger)
110108
)
111109

112110

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

src/backend_api/app/alembic/versions/17daa1c96438_removing_modifier_auto_increment.py

Lines changed: 0 additions & 185 deletions
This file was deleted.

src/backend_api/app/alembic/versions/e38727349f3f_added_unidentified_aggregation_job.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from app.alembic.replaceable_objects.main import ReplaceableTrigger
1515

16+
1617
# revision identifiers, used by Alembic.
1718
revision: str = "e38727349f3f"
1819
down_revision: Union[str, None] = "0f3f15f56b7d"
@@ -24,7 +25,7 @@
2425
"aggregate_unidentified",
2526
"unidentified_item",
2627
"""
27-
RETURNS TRIGGER AS ${name}$
28+
RETURNS TRIGGER AS $aggregate_unidentified$
2829
DECLARE
2930
current_hour INT;
3031
divine_id INT;
@@ -64,12 +65,12 @@
6465
6566
RETURN NEW;
6667
END;
67-
${name}$ LANGUAGE plpgsql;
68+
$aggregate_unidentified$ LANGUAGE plpgsql;
6869
""",
6970
"""
70-
BEFORE INSERT ON {table}
71+
BEFORE INSERT ON unidentified_item
7172
FOR EACH ROW
72-
EXECUTE FUNCTION {name}();
73+
EXECUTE FUNCTION aggregate_unidentified();
7374
""",
7475
)
7576

src/backend_api/app/api/routes/currency.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ async def create_currency(
135135

136136

137137
@router.put(
138-
"/",
138+
"/{currencyId}",
139139
response_model=schemas.Currency,
140140
dependencies=[
141141
Depends(get_current_active_superuser),
@@ -162,7 +162,7 @@ async def update_currency(
162162

163163

164164
@router.delete(
165-
"/",
165+
"/{currencyId}",
166166
response_model=str,
167167
dependencies=[
168168
Depends(get_current_active_superuser),

src/backend_api/app/api/routes/item_base_type.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async def create_item_base_type(
113113

114114

115115
@router.put(
116-
"/",
116+
"/{itemBaseTypeId}",
117117
response_model=schemas.ItemBaseType,
118118
dependencies=[
119119
Depends(get_current_active_superuser),
@@ -141,7 +141,7 @@ async def update_item_base_type(
141141

142142

143143
@router.delete(
144-
"/",
144+
"/{itemBaseTypeId}",
145145
response_model=str,
146146
dependencies=[Depends(get_current_active_superuser)],
147147
)

src/backend_api/app/api/routes/modifier.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ async def create_modifier(
144144
)
145145
async def update_modifier(
146146
modifierId: int,
147-
position: int,
148147
modifier_update: schemas.ModifierUpdate,
149148
db: Session = Depends(get_db),
150149
):
@@ -156,7 +155,7 @@ async def update_modifier(
156155
Returns the updated modifier.
157156
"""
158157

159-
modifier_map = {"modifierId": modifierId, "position": position}
158+
modifier_map = {"modifierId": modifierId}
160159

161160
modifier = await CRUD_modifier.get(
162161
db=db,
@@ -173,7 +172,6 @@ async def update_modifier(
173172
)
174173
async def delete_modifier(
175174
modifierId: int,
176-
position: int,
177175
db: Session = Depends(get_db),
178176
):
179177
"""
@@ -183,7 +181,7 @@ async def delete_modifier(
183181
Always deletes one modifier.
184182
"""
185183

186-
modifier_map = {"modifierId": modifierId, "position": position}
184+
modifier_map = {"modifierId": modifierId}
187185
await CRUD_modifier.remove(db=db, filter=modifier_map)
188186

189187
return get_delete_return_msg(

0 commit comments

Comments
 (0)