|
@@ -0,0 +1,34 @@
|
|
|
|
|
+<?php
|
|
|
|
|
+
|
|
|
|
|
+use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
+use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
|
|
|
+use Illuminate\Support\Facades\Schema;
|
|
|
|
|
+
|
|
|
|
|
+return new class extends Migration
|
|
|
|
|
+{
|
|
|
|
|
+ public function up(): void
|
|
|
|
|
+ {
|
|
|
|
|
+ // Cobrança de ROI/FNM passa a ser ativa por padrão; quem quiser desativar
|
|
|
|
|
+ // faz isso na tab Financeiro da unidade.
|
|
|
|
|
+ Schema::table('unit_financials', function (Blueprint $table) {
|
|
|
|
|
+ $table->boolean('charge_roi')->default(true)->change();
|
|
|
|
|
+ $table->boolean('charge_fnm')->default(true)->change();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // Os flags nunca foram lidos no cálculo, então os valores atuais são apenas
|
|
|
|
|
+ // o default antigo (false). Alinha tudo com "cobrança ligada por padrão".
|
|
|
|
|
+ DB::table('unit_financials')->update([
|
|
|
|
|
+ 'charge_roi' => true,
|
|
|
|
|
+ 'charge_fnm' => true,
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function down(): void
|
|
|
|
|
+ {
|
|
|
|
|
+ Schema::table('unit_financials', function (Blueprint $table) {
|
|
|
|
|
+ $table->boolean('charge_roi')->default(false)->change();
|
|
|
|
|
+ $table->boolean('charge_fnm')->default(false)->change();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+};
|