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
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export class DynamoDBProductRepository extends BaseDynamoDBRepository implements

private async transformFromDynamoDB(item: any): Promise<ProductWithDetails> {
const product: ProductWithDetails = {
id: parseInt(item.id),
id: parseInt(item.PK),
seller_id: parseInt(item.seller_id),
category_id: parseInt(item.category_id),
name: item.product_name || item.name,
Expand Down
10 changes: 5 additions & 5 deletions workshops/modernizr/core-outputs/stage-02/migrationContract.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@
"condition": "parent_id IS NULL",
"target_table": "categories",
"join_condition": "categories.id = categories.parent_id",
"select_column": "categories.name",
"else_value": "ROOT"
"select_column": "'ROOT'",
"else_value": "parent.name"
}
},
{
Expand Down Expand Up @@ -521,7 +521,7 @@
"join": {
"type": "self-join",
"join_alias": "cat_path",
"join_condition": "cat_path.parent_id = categories.id",
"join_condition": "cat_path.id = categories.parent_id",
"select_column": "cat_path.name",
"null_value": ""
},
Expand Down Expand Up @@ -583,8 +583,8 @@
"condition": "parent_id IS NULL",
"target_table": "categories",
"join_condition": "categories.id = categories.parent_id",
"select_column": "categories.id",
"else_value": "ROOT"
"select_column": "'ROOT'",
"else_value": "parent.id"
}
},
{
Expand Down
18 changes: 8 additions & 10 deletions workshops/modernizr/tools/contract_driven_migration_glue_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ def execute_mysql_views_via_mcp(view_sql, mysql_config, config):

mysql_defaults = config.get('mysql', {})

# Parse SQL statements
# Parse SQL statements - improved logic
statements = []
current_statement = ""
in_view = False

for line in view_sql.split('\n'):
line = line.strip()
Expand All @@ -65,16 +64,15 @@ def execute_mysql_views_via_mcp(view_sql, mysql_config, config):
if current_statement:
statements.append(current_statement.strip())
current_statement = line
in_view = True
elif in_view:
else:
current_statement += '\n' + line
if line.endswith(';'):
statements.append(current_statement.strip())
current_statement = ""
in_view = False

if line.endswith(';'):
statements.append(current_statement.strip())
current_statement = ""

if current_statement and in_view:
statements.append(current_statement.strip() + ';')
if current_statement:
statements.append(current_statement.strip())

print(f" 📋 Found {len(statements)} view statements to execute")

Expand Down
Loading