diff --git a/store/app/api/crud/base.py b/store/app/api/crud/base.py index 0dd09544..c4f13408 100644 --- a/store/app/api/crud/base.py +++ b/store/app/api/crud/base.py @@ -32,13 +32,13 @@ async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: # async def _create_dynamodb_table( self, name: str, - columns: list[tuple[str, Literal["S", "N", "B"], Literal["HASH", "RANGE"]]], + keys: list[tuple[str, Literal["S", "N", "B"], Literal["HASH", "RANGE"]]], deletion_protection: bool = False, ) -> None: table = await self.db.create_table( - AttributeDefinitions=[{"AttributeName": n, "AttributeType": t} for n, t, _ in columns], + AttributeDefinitions=[{"AttributeName": n, "AttributeType": t} for n, t, _ in keys], TableName=name, - KeySchema=[{"AttributeName": n, "KeyType": t} for n, _, t in columns], + KeySchema=[{"AttributeName": n, "KeyType": t} for n, _, t in keys], DeletionProtectionEnabled=deletion_protection, BillingMode="PAY_PER_REQUEST", ) diff --git a/store/app/api/db.py b/store/app/api/db.py index 426fdcc1..87ccf076 100644 --- a/store/app/api/db.py +++ b/store/app/api/db.py @@ -33,19 +33,19 @@ async def create_tables(crud: Crud | None = None) -> None: await asyncio.gather( crud._create_dynamodb_table( name="Users", - columns=[ + keys=[ ("id", "S", "HASH"), ], ), crud._create_dynamodb_table( name="Tokens", - columns=[ + keys=[ ("id", "S", "HASH"), ], ), crud._create_dynamodb_table( name="Robots", - columns=[ + keys=[ ("id", "S", "HASH"), ] )