composer update + load more dev dependencies for code quality, checkstyle fix

This commit is contained in:
bs
2026-08-21 23:57:55 -07:00
parent c196dc2fe0
commit 8e142f56ab
104 changed files with 6341 additions and 6743 deletions
@@ -3,42 +3,42 @@ declare(strict_types=1);
use Migrations\AbstractMigration;
class CreateProductCatalogs extends AbstractMigration
{
/**
class CreateProductCatalogs extends AbstractMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_catalogs', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('catalog_description', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->addIndex([
'name',
], [
'name' => 'BY_NAME',
'unique' => true,
]);
$table->create();
}
public function change(): void {
$table = $this->table('product_catalogs', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('catalog_description', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->addIndex([
'name',
], [
'name' => 'BY_NAME',
'unique' => true,
]);
$table->create();
}
}
@@ -3,36 +3,35 @@ declare(strict_types=1);
use Migrations\AbstractMigration;
class CreateProductCategories extends AbstractMigration
{
/**
class CreateProductCategories extends AbstractMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_categories');
public function change(): void {
$table = $this->table('product_categories');
$table->addColumn('product_catalog_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('internal_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('category_description', 'text', [
'default' => null,
'null' => true,
]);
$table->addColumn('product_catalog_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('internal_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('category_description', 'text', [
'default' => null,
'null' => true,
]);
// $table->addColumn('shopify_v1_id', 'integer', [
// 'default' => null,
// 'limit' => 11,
@@ -43,36 +42,37 @@ class CreateProductCategories extends AbstractMigration
// 'limit' => 255,
// 'null' => true,
// ]);
$table->addColumn('parent_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->addColumn('lft', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('rght', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => false,
'null' => false,
]);
$table->addColumn('parent_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->addColumn('lft', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('rght', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => false,
'null' => false,
]);
$table->addIndex('parent_id');
$table->addIndex('lft');
$table->addIndex('product_catalog_id');
$table->addIndex([
'product_catalog_id',
'name',
], [
'name' => 'BY_NAME_AND_CATALOG_ID',
'unique' => true,
]);
$table->create();
}
$table->addIndex('parent_id');
$table->addIndex('lft');
$table->addIndex('product_catalog_id');
$table->addIndex([
'product_catalog_id',
'name',
], [
'name' => 'BY_NAME_AND_CATALOG_ID',
'unique' => true,
]);
$table->create();
}
}
@@ -3,38 +3,37 @@ declare(strict_types=1);
use Migrations\AbstractMigration;
class CreateProducts extends AbstractMigration
{
/**
class CreateProducts extends AbstractMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('products', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('product_category_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_type_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addIndex('product_category_id');
$table->addIndex('product_type_id');
public function change(): void {
$table = $this->table('products', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('product_category_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_type_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addIndex('product_category_id');
$table->addIndex('product_type_id');
// $table->addIndex([
// 'product_category_id',
// 'name',
@@ -42,6 +41,7 @@ class CreateProducts extends AbstractMigration
// 'name' => 'BY_NAME_AND_CATEGORY_ID',
// 'unique' => true,
// ]);
$table->create();
}
$table->create();
}
}
@@ -3,53 +3,53 @@ declare(strict_types=1);
use Migrations\AbstractMigration;
class CreateProductCategoryAttributes extends AbstractMigration
{
/**
class CreateProductCategoryAttributes extends AbstractMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_category_attributes', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('product_category_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('attribute_type_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->addIndex([
'product_category_id',
], [
'name' => 'BY_PRODUCT_CATEGORY_ID',
'unique' => false,
]);
$table->addIndex([
'name',
'product_category_id',
], [
'name' => 'BY_NAME_AND_PRODUCT_CATEGORY_ID_UNIQUE',
'unique' => true,
]);
$table->create();
}
public function change(): void {
$table = $this->table('product_category_attributes', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('product_category_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('attribute_type_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->addIndex([
'product_category_id',
], [
'name' => 'BY_PRODUCT_CATEGORY_ID',
'unique' => false,
]);
$table->addIndex([
'name',
'product_category_id',
], [
'name' => 'BY_NAME_AND_PRODUCT_CATEGORY_ID_UNIQUE',
'unique' => true,
]);
$table->create();
}
}
@@ -3,46 +3,46 @@ declare(strict_types=1);
use Migrations\AbstractMigration;
class CreateProductCategoryAttributeOptions extends AbstractMigration
{
/**
class CreateProductCategoryAttributeOptions extends AbstractMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_category_attribute_options', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_category_attribute_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('attribute_value', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('attribute_label', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => true,
'null' => false,
]);
$table->addIndex([
'product_category_attribute_id',
], [
'name' => 'BY_PRODUCT_CATEGORY_ATTRIBUTE_ID',
'unique' => false,
]);
$table->create();
}
public function change(): void {
$table = $this->table('product_category_attribute_options', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_category_attribute_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('attribute_value', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('attribute_label', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => true,
'null' => false,
]);
$table->addIndex([
'product_category_attribute_id',
], [
'name' => 'BY_PRODUCT_CATEGORY_ATTRIBUTE_ID',
'unique' => false,
]);
$table->create();
}
}
@@ -3,54 +3,54 @@ declare(strict_types=1);
use Migrations\AbstractMigration;
class CreateExternalProductCatalogs extends AbstractMigration
{
/**
class CreateExternalProductCatalogs extends AbstractMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('external_product_catalogs', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_catalog_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('base_url', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('api_url', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->addIndex([
'product_catalog_id',
], [
'name' => 'BY_PRODUCT_CATALOG_ID',
'unique' => false,
]);
$table->create();
}
public function change(): void {
$table = $this->table('external_product_catalogs', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_catalog_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('base_url', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('api_url', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->addIndex([
'product_catalog_id',
], [
'name' => 'BY_PRODUCT_CATALOG_ID',
'unique' => false,
]);
$table->create();
}
}
@@ -3,20 +3,20 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class RemoveCatalogIdFromExternalProductCatalogs extends BaseMigration
{
/**
class RemoveCatalogIdFromExternalProductCatalogs extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('external_product_catalogs');
$table->removeColumn('product_catalog_id');
$table->removeColumn('enabled');
$table->update();
}
public function change(): void {
$table = $this->table('external_product_catalogs');
$table->removeColumn('product_catalog_id');
$table->removeColumn('enabled');
$table->update();
}
}
@@ -3,34 +3,34 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class CreateExternalProductCatalogsProductCatalogs extends BaseMigration
{
/**
class CreateExternalProductCatalogsProductCatalogs extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('external_product_catalogs_product_catalogs');
$table->addColumn('external_product_catalog_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_catalog_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->create();
}
public function change(): void {
$table = $this->table('external_product_catalogs_product_catalogs');
$table->addColumn('external_product_catalog_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_catalog_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->create();
}
}
@@ -3,39 +3,39 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class CreateProductAttributes extends BaseMigration
{
/**
class CreateProductAttributes extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_attributes', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_category_attribute_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('attribute_value', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
]);
$table->addColumn('product_category_attribute_option_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->create();
}
public function change(): void {
$table = $this->table('product_attributes', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_category_attribute_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('attribute_value', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
]);
$table->addColumn('product_category_attribute_option_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->create();
}
}
@@ -3,64 +3,64 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class AddSoftDeleteToAllTables extends BaseMigration
{
/**
class AddSoftDeleteToAllTables extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('products');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
public function change(): void {
$table = $this->table('products');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_category_attributes');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_category_attributes');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_category_attribute_options');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_category_attribute_options');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_categories');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_categories');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_catalogs');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_catalogs');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('external_product_catalogs_product_catalogs');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('external_product_catalogs_product_catalogs');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_attributes');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
}
$table = $this->table('product_attributes');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
}
}
@@ -3,60 +3,60 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class CreateProductSkus extends BaseMigration
{
/**
class CreateProductSkus extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_skus', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('sku', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('barcode', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
]);
$table->addColumn('price', 'decimal', [
'default' => null,
'precision' => 15,
'scale' => 6,
'null' => true,
]);
$table->addColumn('cost', 'decimal', [
'default' => null,
'precision' => 15,
'scale' => 6,
'null' => true,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('modified', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->create();
}
public function change(): void {
$table = $this->table('product_skus', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('sku', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('barcode', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
]);
$table->addColumn('price', 'decimal', [
'default' => null,
'precision' => 15,
'scale' => 6,
'null' => true,
]);
$table->addColumn('cost', 'decimal', [
'default' => null,
'precision' => 15,
'scale' => 6,
'null' => true,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('modified', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->create();
}
}
@@ -3,51 +3,50 @@ declare(strict_types=1);
use Migrations\AbstractMigration;
class CreateProductCategoryVariants extends AbstractMigration
{
/**
class CreateProductCategoryVariants extends AbstractMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_category_variants', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('product_category_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('product_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->addIndex([
'product_category_id',
], [
'name' => 'VARIANTS_BY_PRODUCT_CATEGORY_ID',
'unique' => false,
]);
$table->addIndex([
'product_id',
], [
'name' => 'CATEGORY_VARIANTS_BY_PRODUCT_ID',
'unique' => false,
]);
public function change(): void {
$table = $this->table('product_category_variants', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('product_category_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('product_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->addIndex([
'product_category_id',
], [
'name' => 'VARIANTS_BY_PRODUCT_CATEGORY_ID',
'unique' => false,
]);
$table->addIndex([
'product_id',
], [
'name' => 'CATEGORY_VARIANTS_BY_PRODUCT_ID',
'unique' => false,
]);
// $table->addIndex([
// 'name',
// 'product_category_id',
@@ -56,6 +55,7 @@ class CreateProductCategoryVariants extends AbstractMigration
// 'name' => 'VARIANTS_BY_NAME_AND_PRODUCT_CATEGORY_ID_AND_PRODUCT_ID_UNIQUE',
// 'unique' => true,
// ]);
$table->create();
}
$table->create();
}
}
@@ -3,54 +3,54 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class CreateProductCategoryVariantOptions extends BaseMigration
{
/**
class CreateProductCategoryVariantOptions extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_category_variant_options', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_category_variant_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('variant_value', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('variant_label', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('modified', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('enabled', 'boolean', [
'default' => true,
'null' => false,
]);
public function change(): void {
$table = $this->table('product_category_variant_options', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_category_variant_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('variant_value', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('variant_label', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('modified', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('enabled', 'boolean', [
'default' => true,
'null' => false,
]);
// $table->addForeignKey('product_category_variant_id', 'product_category_variants'); // @TODO why cant this be included??? breaks tests on tearDown
$table->create();
}
$table->create();
}
}
@@ -3,23 +3,23 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class AddDefaultProductTypeIdToProductCategories extends BaseMigration
{
/**
class AddDefaultProductTypeIdToProductCategories extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_categories');
$table->addColumn('default_product_type_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->update();
}
public function change(): void {
$table = $this->table('product_categories');
$table->addColumn('default_product_type_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->update();
}
}
@@ -3,9 +3,9 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class CreateProductPhotos extends BaseMigration
{
/**
class CreateProductPhotos extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
@@ -13,75 +13,75 @@ class CreateProductPhotos extends BaseMigration
*
* @return void
*/
public function change(): void
{
$table = $this->table('product_photos', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_sku_id', 'uuid', [
'default' => null,
'null' => true,
]);
public function change(): void {
$table = $this->table('product_photos', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_sku_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('photo_dir', 'text', [
'default' => null,
'length' => 255,
'null' => false,
]);
$table->addColumn('photo_filename', 'string', [
'default' => null,
'length' => 255,
'null' => false,
]);
$table->addColumn('photo_dir', 'text', [
'default' => null,
'length' => 255,
'null' => false,
]);
$table->addColumn('photo_filename', 'string', [
'default' => null,
'length' => 255,
'null' => false,
]);
$table->addColumn('primary_photo', 'boolean', [
'default' => false,
'null' => false,
]);
$table->addColumn('primary_photo', 'boolean', [
'default' => false,
'null' => false,
]);
$table->addColumn('photo_position', 'integer', [
'default' => 100,
'limit' => 11,
'null' => false,
]);
$table->addColumn('photo_position', 'integer', [
'default' => 100,
'limit' => 11,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => false,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => false,
'null' => false,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('modified', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('modified', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addIndex([
'product_id',
], [
'name' => 'PRODUCT_PHOTOS_BY_PRODUCT_ID',
'unique' => false,
]);
$table->addIndex([
'product_sku_id',
], [
'name' => 'PRODUCT_PHOTOS_BY_PRODUCT_SKU_ID',
'unique' => false,
]);
$table->addIndex([
'product_id',
], [
'name' => 'PRODUCT_PHOTOS_BY_PRODUCT_ID',
'unique' => false,
]);
$table->addIndex([
'product_sku_id',
], [
'name' => 'PRODUCT_PHOTOS_BY_PRODUCT_SKU_ID',
'unique' => false,
]);
$table->create();
}
$table->create();
}
}
@@ -3,9 +3,9 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class CreateProductSkuVariantValues extends BaseMigration
{
/**
class CreateProductSkuVariantValues extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
@@ -13,25 +13,25 @@ class CreateProductSkuVariantValues extends BaseMigration
*
* @return void
*/
public function change(): void
{
$table = $this->table('product_sku_variant_values', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_sku_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_variant_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_category_variant_option_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->create();
}
public function change(): void {
$table = $this->table('product_sku_variant_values', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_sku_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_variant_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('product_category_variant_option_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->create();
}
}
@@ -3,9 +3,9 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class CreateProductVariants extends BaseMigration
{
/**
class CreateProductVariants extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
@@ -13,42 +13,41 @@ class CreateProductVariants extends BaseMigration
*
* @return void
*/
public function change(): void
{
$table = $this->table('product_variants', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('product_category_variant_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('product_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->addIndex([
'product_category_variant_id',
], [
'name' => 'VARIANTS_BY_PARENT_PRODUCT_CATEGORY_VARIANT_ID',
'unique' => false,
]);
$table->addIndex([
'product_id',
], [
'name' => 'VARIANTS_BY_PRODUCT_ID',
'unique' => false,
]);
public function change(): void {
$table = $this->table('product_variants', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('product_category_variant_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('product_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->addIndex([
'product_category_variant_id',
], [
'name' => 'VARIANTS_BY_PARENT_PRODUCT_CATEGORY_VARIANT_ID',
'unique' => false,
]);
$table->addIndex([
'product_id',
], [
'name' => 'VARIANTS_BY_PRODUCT_ID',
'unique' => false,
]);
// $table->addIndex([
// 'name',
@@ -57,6 +56,7 @@ class CreateProductVariants extends BaseMigration
// 'name' => 'VARIANTS_BY_NAME_AND_PRODUCT_CATEGORY_ID_UNIQUE',
// 'unique' => true,
// ]);
$table->create();
}
$table->create();
}
}
@@ -3,23 +3,23 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class AddDefaultSkuToProductSkus extends BaseMigration
{
/**
class AddDefaultSkuToProductSkus extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_skus');
$table->addColumn('default_sku', 'boolean', [
'default' => false,
'limit' => 11,
'null' => false,
]);
$table->update();
}
public function change(): void {
$table = $this->table('product_skus');
$table->addColumn('default_sku', 'boolean', [
'default' => false,
'limit' => 11,
'null' => false,
]);
$table->update();
}
}
@@ -3,9 +3,9 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class AddProductCategoryIdToProductPhotos extends BaseMigration
{
/**
class AddProductCategoryIdToProductPhotos extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
@@ -13,17 +13,17 @@ class AddProductCategoryIdToProductPhotos extends BaseMigration
*
* @return void
*/
public function change(): void
{
$table = $this->table('product_photos');
$table->addColumn('product_category_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('primary_category_photo', 'boolean', [
'default' => false,
'null' => false,
]);
$table->update();
}
public function change(): void {
$table = $this->table('product_photos');
$table->addColumn('product_category_id', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('primary_category_photo', 'boolean', [
'default' => false,
'null' => false,
]);
$table->update();
}
}
@@ -3,23 +3,23 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class AddPrimarySkuPhotoToProductPhotos extends BaseMigration
{
/**
class AddPrimarySkuPhotoToProductPhotos extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_photos');
$table->addColumn('primary_sku_photo', 'boolean', [
'default' => false,
'limit' => 11,
'null' => false,
]);
$table->update();
}
public function change(): void {
$table = $this->table('product_photos');
$table->addColumn('primary_sku_photo', 'boolean', [
'default' => false,
'limit' => 11,
'null' => false,
]);
$table->update();
}
}
@@ -3,51 +3,50 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class AllowProductIdToBeNullInProductPhotos extends BaseMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function up(): void
{
$table = $this->table('product_photos');
$table->changeColumn('product_id', 'uuid', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->changeColumn('product_category_id', 'uuid', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->update();
}
class AllowProductIdToBeNullInProductPhotos extends BaseMigration {
/**
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function down(): void
{
$table = $this->table('product_photos');
$table->changeColumn('product_id', 'uuid', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->changeColumn('product_category_id', 'uuid', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->update();
}
public function up(): void {
$table = $this->table('product_photos');
$table->changeColumn('product_id', 'uuid', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->changeColumn('product_category_id', 'uuid', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->update();
}
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function down(): void {
$table = $this->table('product_photos');
$table->changeColumn('product_id', 'uuid', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->changeColumn('product_category_id', 'uuid', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->update();
}
}
@@ -3,23 +3,23 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class AddIsSystemToProductCategoryVariants extends BaseMigration
{
/**
class AddIsSystemToProductCategoryVariants extends BaseMigration {
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_category_variants');
$table->addColumn('is_system_variant', 'boolean', [
'default' => false,
'limit' => 11,
'null' => false,
]);
$table->update();
}
public function change(): void {
$table = $this->table('product_category_variants');
$table->addColumn('is_system_variant', 'boolean', [
'default' => false,
'limit' => 11,
'null' => false,
]);
$table->update();
}
}
@@ -3,14 +3,15 @@ declare(strict_types=1);
namespace Seeds;
use Cake\Utility\Text;
use Migrations\BaseSeed;
/**
* CreateSystemCategoryVariants seed.
*/
class CreateSystemCategoryVariantsSeed extends BaseSeed
{
/**
class CreateSystemCategoryVariantsSeed extends BaseSeed {
/**
* Run Method.
*
* Write your database seeder using this method.
@@ -20,36 +21,36 @@ class CreateSystemCategoryVariantsSeed extends BaseSeed
*
* @return void
*/
public function run(): void
{
$data = [
[
'id' => \Cake\Utility\Text::uuid(),
'name' => 'Subscription Length',
'product_category_id' => null,
'enabled' => true,
'is_system_variant' => true,
],
[
'id' => \Cake\Utility\Text::uuid(),
'name' => 'Subscription Length Units',
'product_category_id' => null,
'enabled' => true,
'is_system_variant' => true,
],
];
$table = $this->table('product_category_variants');
$toInsert = [];
foreach ($data as $singleRecordToInsert) {
$stmt = $this->query('SELECT * FROM product_category_variants WHERE name="' . $singleRecordToInsert['name'] . '" AND product_category_id IS NULL;'); // returns PDOStatement
$rows = $stmt->fetchAll(); // returns the result as an array
if ($rows) {
continue;
}
$toInsert[] = $singleRecordToInsert;
}
if ($toInsert) {
$table->insert($data)->save();
}
}
public function run(): void {
$data = [
[
'id' => Text::uuid(),
'name' => 'Subscription Length',
'product_category_id' => null,
'enabled' => true,
'is_system_variant' => true,
],
[
'id' => Text::uuid(),
'name' => 'Subscription Length Units',
'product_category_id' => null,
'enabled' => true,
'is_system_variant' => true,
],
];
$table = $this->table('product_category_variants');
$toInsert = [];
foreach ($data as $singleRecordToInsert) {
$stmt = $this->query('SELECT * FROM product_category_variants WHERE name="' . $singleRecordToInsert['name'] . '" AND product_category_id IS NULL;'); // returns PDOStatement
$rows = $stmt->fetchAll(); // returns the result as an array
if ($rows) {
continue;
}
$toInsert[] = $singleRecordToInsert;
}
if ($toInsert) {
$table->insert($data)->save();
}
}
}
+12 -12
View File
@@ -4,10 +4,10 @@
return [
'CakeProducts' => [
'photos' => [
'directory' => WWW_ROOT . 'images' . DS . 'products' . DS,
],
/**
'photos' => [
'directory' => WWW_ROOT . 'images' . DS . 'products' . DS,
],
/**
* internal CakeProducts settings - used in the source of truth/internal only system.
* Can optionally manage external catalogs
*
@@ -15,17 +15,17 @@ return [
* which will receive changes to the catalogs and optionally allow for external API access.
* Will have no effect if true but no external catalogs have been added or none are enabled
*/
'internal' => [
'enabled' => true,
/**
'internal' => [
'enabled' => true,
/**
* syncExternally defaults to false - product catalogs can have 1 or more external catalogs linked to them
* which will receive changes to the catalogs and optionally allow for external API access.
* Will have no effect if true but no external catalogs have been added or none are enabled
*/
'syncExternally' => false,
],
'external' => [ // product catalog settings for external use (as an API server to power an ecommerce site for example)
'enabled' => false,
],
'syncExternally' => false,
],
'external' => [ // product catalog settings for external use (as an API server to power an ecommerce site for example)
'enabled' => false,
],
],
];