fix(schema): declare the column defaults the database already has
doctrine:schema:update kept proposing the same two ALTERs on every run, because three columns carry a default in MariaDB that the mapping never declared. The drift was noise, but it hid real diffs: both tenant migrations in this series picked these ALTERs up as unrelated changes that had to be stripped by hand. All three fields already default in PHP (0, 0, and STATUS_CONFIRMED), and the database columns already match, so the fix is to state the default in the mapping rather than alter live tables. schema:update now reports the schema in sync and migrations:diff finds nothing. Tests: 856 passing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -95,11 +95,11 @@ class PatientSession
|
||||
private ?string $discountType = null;
|
||||
|
||||
/** مقدار خام تخفیف (درصد یا ریال، بسته به نوع) */
|
||||
#[ORM\Column(name: 'discount_value', type: 'integer')]
|
||||
#[ORM\Column(name: 'discount_value', type: 'integer', options: ['default' => 0])]
|
||||
private int $discountValue = 0;
|
||||
|
||||
/** مبلغ محاسبهشدهی تخفیف به ریال (سقف: مبلغ نهایی) */
|
||||
#[ORM\Column(name: 'discount_rials', type: 'integer')]
|
||||
#[ORM\Column(name: 'discount_rials', type: 'integer', options: ['default' => 0])]
|
||||
private int $discountRials = 0;
|
||||
|
||||
/** منبع تخفیف: id قانون تخفیف اعمالشده (audit)؛ null اگر دستی یا بدون تخفیف */
|
||||
|
||||
@@ -64,7 +64,7 @@ class WalletTransaction
|
||||
#[ORM\Column(type: 'string', length: 120, nullable: true)]
|
||||
private ?string $reference = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 15)]
|
||||
#[ORM\Column(type: 'string', length: 15, options: ['default' => self::STATUS_CONFIRMED])]
|
||||
private string $status = self::STATUS_CONFIRMED;
|
||||
|
||||
#[ORM\Column(name: 'created_at', type: 'integer')]
|
||||
|
||||
Reference in New Issue
Block a user