Skip to content

Commit

Permalink
Merge pull request #284 from wri/fix/TM-961-modify-migration-workday-…
Browse files Browse the repository at this point in the history
…demographics

[TM-961] verify existence of workday_demographics table in migration
  • Loading branch information
cesarLima1 authored Jun 13, 2024
2 parents 1b9c6a6 + b94ed2a commit 2f9e00c
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
return new class () extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('workday_demographics', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Workday::class);
$table->string('type');
$table->string('subtype')->nullable();
$table->string('name')->nullable();
$table->integer('amount');
if (! Schema::hasTable('workday_demographics')) {
Schema::create('workday_demographics', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Workday::class);
$table->string('type');
$table->string('subtype')->nullable();
$table->string('name')->nullable();
$table->integer('amount');

$table->softDeletes();
$table->timestamps();
});
$table->softDeletes();
$table->timestamps();
});
}
}

/**
Expand Down

0 comments on commit 2f9e00c

Please sign in to comment.