default sku boolean to product skus table

This commit is contained in:
2025-10-06 23:21:50 -07:00
parent 81a9f827db
commit 25957f7d8b
3 changed files with 35 additions and 0 deletions

View File

@@ -97,6 +97,13 @@ class ProductsTable extends Table
'dependent' => true,
]);
$this->hasOne('DefaultProductSkus', [
'foreignKey' => 'product_id',
'conditions' => ['PrimaryProductSkus.default_sku' => true],
'className' => 'CakeProducts.ProductSkus',
'dependent' => true,
]);
$this->getSchema()->setColumnType('product_type_id', EnumType::from(ProductProductTypeId::class));
$this->addBehavior('Muffin/Trash.Trash');