Fix asset_type and bundle_role to match MySQL ENUM definitions
This commit is contained in:
@@ -103,8 +103,16 @@ foreach ($entries as $entry) {
|
|||||||
'sha256' => $sha,
|
'sha256' => $sha,
|
||||||
'byte_size' => $bytes,
|
'byte_size' => $bytes,
|
||||||
'storage_key' => sprintf('staged/grade_10/%s/%s', substr($sha, 0, 12), $relativePath),
|
'storage_key' => sprintf('staged/grade_10/%s/%s', substr($sha, 0, 12), $relativePath),
|
||||||
'asset_type' => $resourceType === 'lesson' ? 'lesson_markdown' : 'supporting_markdown',
|
'asset_type' => match ($resourceType) {
|
||||||
'bundle_role' => $resourceType === 'lesson' ? 'primary_lesson' : 'supporting_resource',
|
'lesson' => 'lesson_markdown',
|
||||||
|
'worksheet' => 'worksheet_markdown',
|
||||||
|
default => 'other',
|
||||||
|
},
|
||||||
|
'bundle_role' => match ($resourceType) {
|
||||||
|
'lesson' => 'primary_lesson',
|
||||||
|
'worksheet' => 'worksheet',
|
||||||
|
default => 'supporting',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user