update table

This commit is contained in:
2025-12-13 00:14:24 -03:00
parent 72f049babd
commit a1c0e3dcd5
6 changed files with 191 additions and 95 deletions

View File

@@ -43,9 +43,11 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
now_ = now()
org_id = new_image['org_id']
enrollment = enrollment_layer.collection.get_items(
TransactKey(new_image['id']) + SortKey('0') + SortKey('author')
# Post-migration: uncomment the following line
# + SortKey('CREATED_BY')
TransactKey(new_image['id'])
+ SortKey('0')
+ SortKey('CREATED_BY', rename_key='created_by', path_spec='created_by')
# Post-migration: remove the following line
+ SortKey('author', rename_key='created_by')
)
if not enrollment:
@@ -99,7 +101,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
# Add enrollment entry to billing
try:
created_by = enrollment.get('author')
created_by = enrollment.get('created_by')
course_id = enrollment['course']['id']
course = course_layer.collection.get_items(
KeyPair(