|
|
@@ -0,0 +1,26 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+use Illuminate\Database\Migrations\Migration;
|
|
|
+use Illuminate\Database\Schema\Blueprint;
|
|
|
+use Illuminate\Support\Facades\Schema;
|
|
|
+
|
|
|
+return new class extends Migration
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * Permite gerar o TBR automaticamente (schedule mensal) sem um usuário logado.
|
|
|
+ * user_id nulo = gerado pelo sistema.
|
|
|
+ */
|
|
|
+ public function up(): void
|
|
|
+ {
|
|
|
+ Schema::table('tbr_calculations', function (Blueprint $table) {
|
|
|
+ $table->foreignId('user_id')->nullable()->change();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ public function down(): void
|
|
|
+ {
|
|
|
+ Schema::table('tbr_calculations', function (Blueprint $table) {
|
|
|
+ $table->foreignId('user_id')->nullable(false)->change();
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|