30 lines
		
	
	
		
			835 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			835 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
use Illuminate\Database\Migrations\Migration;
 | 
						|
use Illuminate\Database\Schema\Blueprint;
 | 
						|
use Illuminate\Support\Facades\Schema;
 | 
						|
 | 
						|
return new class extends Migration
 | 
						|
{
 | 
						|
    public function up(): void
 | 
						|
    {
 | 
						|
        Schema::create('contact_meta', function (Blueprint $table) {
 | 
						|
            $table->unsignedInteger('card_id')->primary();   // maps to cards.id
 | 
						|
            $table->string('avatar_url')->nullable();
 | 
						|
            $table->string('tags')->nullable();                 // CSV tag list
 | 
						|
            $table->text('notes')->nullable();
 | 
						|
            $table->timestamps();
 | 
						|
 | 
						|
            $table->foreign('card_id')
 | 
						|
                  ->references('id')
 | 
						|
                  ->on('cards')
 | 
						|
                  ->cascadeOnDelete();
 | 
						|
        });
 | 
						|
    }
 | 
						|
 | 
						|
    public function down(): void
 | 
						|
    {
 | 
						|
        Schema::dropIfExists('contact_meta');
 | 
						|
    }
 | 
						|
};
 |