phpcbf and added .gitea workflows

This commit is contained in:
2026-01-23 20:32:22 -08:00
parent 4b45725b33
commit a033c13b8d
24 changed files with 949 additions and 919 deletions

View File

@@ -3,112 +3,112 @@ declare(strict_types=1);
use Migrations\BaseMigration;
class CreateCarts extends BaseMigration
{
/**
class CreateCarts 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('carts', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('cart_type_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('session_id', 'string', [
'default' => null,
'null' => true,
]);
$table->addColumn('user_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->addColumn('user_id_uuid', 'uuid', [
'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->addColumn('removed', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('removed_reason_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->addColumn('num_items', 'integer', [
'default' => 0,
'null' => false,
]);
$table->create();
public function change(): void {
$table = $this->table('carts', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('cart_type_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('session_id', 'string', [
'default' => null,
'null' => true,
]);
$table->addColumn('user_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->addColumn('user_id_uuid', 'uuid', [
'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->addColumn('removed', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('removed_reason_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->addColumn('num_items', 'integer', [
'default' => 0,
'null' => false,
]);
$table->create();
$table = $this->table('cart_items', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('foreign_key', 'integer', [
'default' => null,
'null' => true,
]);
$table->addColumn('foreign_key_uuid', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('model', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('cart_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('position', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->addColumn('qty', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('price', 'decimal', [
'default' => null,
'null' => true,
'precision' => 13,
'scale' => 5,
]);
$table->addColumn('subtotal', 'decimal', [
'default' => null,
'null' => true,
'precision' => 13,
'scale' => 5,
]);
$table = $this->table('cart_items', ['id' => false, 'primary_key' => ['id']]);
$table->addColumn('id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('foreign_key', 'integer', [
'default' => null,
'null' => true,
]);
$table->addColumn('foreign_key_uuid', 'uuid', [
'default' => null,
'null' => true,
]);
$table->addColumn('model', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('cart_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('position', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->addColumn('qty', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('price', 'decimal', [
'default' => null,
'null' => true,
'precision' => 13,
'scale' => 5,
]);
$table->addColumn('subtotal', 'decimal', [
'default' => null,
'null' => true,
'precision' => 13,
'scale' => 5,
]);
$table->create();
}
$table->create();
}
}