feat: ajout entity OrderNumber pour la gestion des numeros de commande
src/Entity/OrderNumber.php (nouveau): - id: int auto-increment - numOrder: string(50) unique, le numero de commande - createdAt: DateTimeImmutable, date de creation (auto dans le constructeur) - isUsed: bool, false par defaut, marque via markAsUsed() src/Repository/OrderNumberRepository.php (nouveau): - Repository Doctrine standard pour OrderNumber migrations/Version20260402201935.php: - Table order_number avec index unique sur num_order - created_at TIMESTAMP, is_used BOOLEAN Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
32
migrations/Version20260402201935.php
Normal file
32
migrations/Version20260402201935.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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 Version20260402201935 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 order_number (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, num_order VARCHAR(50) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, is_used BOOLEAN NOT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_551F0F81B2AA22EE ON order_number (num_order)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('DROP TABLE order_number');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user