S2a: purge legacy Form Builder PHP code and routes
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* S2a — drops the three remaining legacy registration tables now that every
|
||||
* PHP caller (controllers / services / requests / resources / policies /
|
||||
* models / tests) has been purged. The forms:migrate-legacy-data command
|
||||
* self-skips when these tables are absent, so environments with real
|
||||
* legacy data can still run the migration command BEFORE running this
|
||||
* drop migration to move their data onto the new form_* tables.
|
||||
*
|
||||
* down() is a hard failure: restoring these tables and repopulating them
|
||||
* from the new form_* structure would be a lossy, non-trivial conversion
|
||||
* and there is no supported path back. Use migrate:fresh + restore from
|
||||
* backup if you genuinely need the legacy state.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
// person_field_values has a FK to registration_form_fields; drop
|
||||
// it first to avoid constraint ordering issues.
|
||||
Schema::dropIfExists('person_field_values');
|
||||
Schema::dropIfExists('registration_form_fields');
|
||||
Schema::dropIfExists('registration_field_templates');
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
throw new \RuntimeException(
|
||||
'Legacy registration tables cannot be restored. Use migrate:fresh '
|
||||
.'or restore from a pre-S2a backup.'
|
||||
);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user