diff --git a/db/migrations/20260816000000_make_transaction_payment_type_nullable.php b/db/migrations/20260816000000_make_transaction_payment_type_nullable.php new file mode 100644 index 000000000..8cfccc2eb --- /dev/null +++ b/db/migrations/20260816000000_make_transaction_payment_type_nullable.php @@ -0,0 +1,34 @@ +table('compta') + ->changeColumn('idmode_regl', 'integer', [ + 'limit' => 5, + 'null' => true, + 'default' => null, + ]) + ->update(); + + $this->execute('UPDATE compta SET idmode_regl = NULL WHERE idmode_regl = 0'); + } + + public function down(): void + { + $this->execute('UPDATE compta SET idmode_regl = 0 WHERE idmode_regl IS NULL'); + + $this->table('compta') + ->changeColumn('idmode_regl', 'integer', [ + 'limit' => 5, + 'null' => false, + 'default' => 0, + ]) + ->update(); + } +} diff --git a/db/seeds/ComptaCompte.php b/db/seeds/ComptaCompte.php index d515d6e77..05b5e4874 100644 --- a/db/seeds/ComptaCompte.php +++ b/db/seeds/ComptaCompte.php @@ -27,6 +27,14 @@ public function run(): void 'nom_compte' => 'Paypal', 'archived_at' => new DateTime('last year')->format('Y-m-d H:i:s'), ], + [ + 'id' => 5, + 'nom_compte' => 'Compte courant CMUT', + ], + [ + 'id' => 6, + 'nom_compte' => 'Livret CMUT', + ], ]; $table = $this->table('compta_compte');