File: //home/xedaptot/ai.naniguide.com/database/migrations/2026_04_17_200000_add_source_to_templates.php
<?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
{
Schema::table('templates', function (Blueprint $table) {
$table->string('source', 20)->default('builder');
});
DB::table('templates')->whereNull('source')->update(['source' => 'builder']);
}
public function down(): void
{
Schema::table('templates', function (Blueprint $table) {
$table->dropColumn('source');
});
}
};