Ajoute un CRUD pour les produits en admin. Affiche les produits en boutique. Ajoute les schemas JSON-LD pour chaque produit.
35 lines
1.6 KiB
PHP
35 lines
1.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
*/
|
|
final class Version20251119115552 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return '';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
// this up() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('CREATE TABLE products (id SERIAL NOT NULL, name VARCHAR(255) NOT NULL, is_active BOOLEAN NOT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, price DOUBLE PRECISION NOT NULL, is_promo BOOLEAN NOT NULL, is_handmade BOOLEAN NOT NULL, is_custom BOOLEAN NOT NULL, state VARCHAR(255) NOT NULL, short_description VARCHAR(255) DEFAULT NULL, long_description TEXT DEFAULT NULL, image_file_name VARCHAR(255) DEFAULT NULL, image_dimensions JSON DEFAULT NULL, image_size VARCHAR(255) DEFAULT NULL, image_mine_type VARCHAR(255) DEFAULT NULL, image_original_name VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
|
|
$this->addSql('COMMENT ON COLUMN products.create_at IS \'(DC2Type:datetime_immutable)\'');
|
|
$this->addSql('COMMENT ON COLUMN products.update_at IS \'(DC2Type:datetime_immutable)\'');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('CREATE SCHEMA public');
|
|
$this->addSql('DROP TABLE products');
|
|
}
|
|
}
|