fix(database): guard dropIfExists in multi-connection migrations by local/testing environment (F-2026-0004)
This commit is contained in:
parent
18b83b6e67
commit
6eb9be9156
4 changed files with 12 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue