fix(database): guard dropIfExists in multi-connection migrations by local/testing environment (F-2026-0004)

This commit is contained in:
Jérémy Munsch 2026-08-26 09:59:06 +02:00
parent 18b83b6e67
commit 6eb9be9156
Signed by: forge-joniko
GPG key ID: D7EFE2F5CB6CC0E4
4 changed files with 12 additions and 4 deletions

View file

@ -16,7 +16,9 @@ return new class () extends Migration
{
$schema = Schema::connection(Config::string('database.arcadia_meta_model'));
$schema->dropIfExists('employees');
if (app()->environment('local', 'testing')) {
$schema->dropIfExists('employees');
}
$schema->create('employees', function (Blueprint $table) {
$table->string('public_employee_number', 8)->primary();

View file

@ -16,7 +16,9 @@ return new class () extends Migration
{
$schema = Schema::connection(Config::string('database.arcadia_meta_model'));
$schema->dropIfExists('inco_sheets');
if (app()->environment('local', 'testing')) {
$schema->dropIfExists('inco_sheets');
}
$schema->create('inco_sheets', function (Blueprint $table) {
$table->string('id')->primary();

View file

@ -16,7 +16,9 @@ return new class () extends Migration
{
$schema = Schema::connection(Config::string('database.arcadia_meta_model'));
$schema->dropIfExists('inco_compos');
if (app()->environment('local', 'testing')) {
$schema->dropIfExists('inco_compos');
}
$schema->create('inco_compos', function (Blueprint $table) {
$table->string('id')->primary();

View file

@ -16,7 +16,9 @@ return new class () extends Migration
{
$schema = Schema::connection(Config::string('database.arcadia_meta_model'));
$schema->dropIfExists('arcadia_brands');
if (app()->environment('local', 'testing')) {
$schema->dropIfExists('arcadia_brands');
}
$schema->create('arcadia_brands', function (Blueprint $table) {
$table->integer('code')->unsigned()->primary();