belongs to many external catalogs & catalogs
	
		
			
	
		
	
	
		
			
				
	
				CI / testsuite (mysql, 8.1, ) (push) Failing after 4s
				
					Details
				
			
		
			
				
	
				CI / testsuite (mysql, 8.4, ) (push) Failing after 3s
				
					Details
				
			
		
			
				
	
				CI / testsuite (pgsql, 8.1, ) (push) Failing after 3s
				
					Details
				
			
		
			
				
	
				CI / testsuite (pgsql, 8.4, ) (push) Failing after 4s
				
					Details
				
			
		
			
				
	
				CI / testsuite (sqlite, 8.1, ) (push) Failing after 4s
				
					Details
				
			
		
			
				
	
				CI / testsuite (sqlite, 8.1, prefer-lowest) (push) Failing after 4s
				
					Details
				
			
		
			
				
	
				CI / testsuite (sqlite, 8.4, ) (push) Failing after 3s
				
					Details
				
			
		
			
				
	
				CI / Coding Standard & Static Analysis (push) Failing after 5m45s
				
					Details
				
			
		
	
				
					
				
			
				
	
				CI / testsuite (mysql, 8.1, ) (push) Failing after 4s
				
					Details
				
			
		
			
				
	
				CI / testsuite (mysql, 8.4, ) (push) Failing after 3s
				
					Details
				
			
		
			
				
	
				CI / testsuite (pgsql, 8.1, ) (push) Failing after 3s
				
					Details
				
			
		
			
				
	
				CI / testsuite (pgsql, 8.4, ) (push) Failing after 4s
				
					Details
				
			
		
			
				
	
				CI / testsuite (sqlite, 8.1, ) (push) Failing after 4s
				
					Details
				
			
		
			
				
	
				CI / testsuite (sqlite, 8.1, prefer-lowest) (push) Failing after 4s
				
					Details
				
			
		
			
				
	
				CI / testsuite (sqlite, 8.4, ) (push) Failing after 3s
				
					Details
				
			
		
			
				
	
				CI / Coding Standard & Static Analysis (push) Failing after 5m45s
				
					Details
				
			
		
	This commit is contained in:
		
							parent
							
								
									3a98baae7c
								
							
						
					
					
						commit
						b627550dd9
					
				|  | @ -0,0 +1,22 @@ | ||||||
|  | <?php | ||||||
|  | declare(strict_types=1); | ||||||
|  | 
 | ||||||
|  | use Migrations\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(); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -0,0 +1,37 @@ | ||||||
|  | <?php | ||||||
|  | declare(strict_types=1); | ||||||
|  | 
 | ||||||
|  | use Migrations\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', 'string', [ | ||||||
|  |             'default' => null, | ||||||
|  |             'limit' => 255, | ||||||
|  |             '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(); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -9,14 +9,12 @@ use Cake\ORM\Entity; | ||||||
|  * ExternalProductCatalog Entity |  * ExternalProductCatalog Entity | ||||||
|  * |  * | ||||||
|  * @property int $id |  * @property int $id | ||||||
|  * @property string $product_catalog_id |  | ||||||
|  * @property string $base_url |  * @property string $base_url | ||||||
|  * @property string $api_url |  * @property string $api_url | ||||||
|  * @property \Cake\I18n\DateTime $created |  * @property \Cake\I18n\DateTime $created | ||||||
|  * @property \Cake\I18n\DateTime|null $deleted |  * @property \Cake\I18n\DateTime|null $deleted | ||||||
|  * @property bool $enabled |  | ||||||
|  * |  * | ||||||
|  * @property \CakeProducts\Model\Entity\ProductCatalog $product_catalog |  * @property \CakeProducts\Model\Entity\ProductCatalog[] $product_catalogs | ||||||
|  */ |  */ | ||||||
| class ExternalProductCatalog extends Entity | class ExternalProductCatalog extends Entity | ||||||
| { | { | ||||||
|  | @ -30,12 +28,11 @@ class ExternalProductCatalog extends Entity | ||||||
|      * @var array<string, bool> |      * @var array<string, bool> | ||||||
|      */ |      */ | ||||||
|     protected array $_accessible = [ |     protected array $_accessible = [ | ||||||
|         'product_catalog_id' => true, |  | ||||||
|         'base_url' => true, |         'base_url' => true, | ||||||
|         'api_url' => true, |         'api_url' => true, | ||||||
|         'created' => true, |         'created' => true, | ||||||
|         'deleted' => true, |         'deleted' => true, | ||||||
|         'enabled' => true, |         'enabled' => true, | ||||||
|         'product_catalog' => true, |         'product_catalogs' => true, | ||||||
|     ]; |     ]; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -13,8 +13,8 @@ use Cake\ORM\Entity; | ||||||
|  * @property string|null $catalog_description |  * @property string|null $catalog_description | ||||||
|  * @property bool $enabled |  * @property bool $enabled | ||||||
|  * |  * | ||||||
|  * @property \CakeProducts\Model\Entity\ProductCategory[] $product_categories |  * @property ProductCategory[] $product_categories | ||||||
|  * @property \CakeProducts\Model\Entity\ExternalProductCatalog[] $external_product_catalogs |  * @property ExternalProductCatalog[] $external_product_catalogs | ||||||
|  */ |  */ | ||||||
| class ProductCatalog extends Entity | class ProductCatalog extends Entity | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -54,9 +54,8 @@ class ExternalProductCatalogsTable extends Table | ||||||
| 
 | 
 | ||||||
|         $this->addBehavior('Timestamp'); |         $this->addBehavior('Timestamp'); | ||||||
| 
 | 
 | ||||||
|         $this->belongsTo('ProductCatalogs', [ |         $this->belongsToMany('ProductCatalogs', [ | ||||||
|             'foreignKey' => 'product_catalog_id', |             'through' => 'CakeProducts.ExternalProductCatalogsProductCatalogs', | ||||||
|             'joinType' => 'INNER', |  | ||||||
|             'className' => 'CakeProducts.ProductCatalogs', |             'className' => 'CakeProducts.ProductCatalogs', | ||||||
|         ]); |         ]); | ||||||
|     } |     } | ||||||
|  | @ -91,11 +90,6 @@ class ExternalProductCatalogsTable extends Table | ||||||
|             ->dateTime('deleted') |             ->dateTime('deleted') | ||||||
|             ->allowEmptyDateTime('deleted'); |             ->allowEmptyDateTime('deleted'); | ||||||
| 
 | 
 | ||||||
|         $validator |  | ||||||
|             ->boolean('enabled') |  | ||||||
|             ->requirePresence('enabled', 'create') |  | ||||||
|             ->notEmptyString('enabled'); |  | ||||||
| 
 |  | ||||||
|         return $validator; |         return $validator; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -53,7 +53,8 @@ class ProductCatalogsTable extends Table | ||||||
|         $this->hasMany('ProductCategories', [ |         $this->hasMany('ProductCategories', [ | ||||||
|             'className' => 'CakeProducts.ProductCategories', |             'className' => 'CakeProducts.ProductCategories', | ||||||
|         ]); |         ]); | ||||||
|         $this->hasMany('ExternalProductCatalogs', [ |         $this->belongsToMany('ExternalProductCatalogs', [ | ||||||
|  |             'through' => 'CakeProducts.ExternalProductCatalogsProductCatalogs', | ||||||
|             'className' => 'CakeProducts.ExternalProductCatalogs', |             'className' => 'CakeProducts.ExternalProductCatalogs', | ||||||
|         ]); |         ]); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -156,7 +156,6 @@ class ExternalProductCatalogsControllerTest extends BaseControllerTest | ||||||
|             'action' => 'add', |             'action' => 'add', | ||||||
|         ]; |         ]; | ||||||
|         $data = [ |         $data = [ | ||||||
|             'product_catalog_id' => 'f56f3412-ed23-490b-be6e-016208c415d2', |  | ||||||
|             'base_url' => 'http://localhost:8766', |             'base_url' => 'http://localhost:8766', | ||||||
|             'api_url' => 'http://localhost:8766/api/v1/', |             'api_url' => 'http://localhost:8766/api/v1/', | ||||||
|             'enabled' => true, |             'enabled' => true, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue