Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
marco76tv authored and Malebestia committed Sep 4, 2023
1 parent 874f9be commit d6ac651
Showing 1 changed file with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Schema\Blueprint;
//----- models -----

//----- bases ----
use Modules\Xot\Database\Migrations\XotBaseMigration;

/**
* Class CreateThemesTable.
*/
class CreateNotifyThemesTable extends XotBaseMigration {
//use XotBaseMigrationTrait;

/**
* Run the migrations.
*
* @return void
*/
public function up() {
//-- CREATE --
$this->tableCreate(
function (Blueprint $table) {
$table->increments('id');
$table->string('lang')->nullable();
$table->string('type')->nullable();
$table->string('subject')->nullable();
$table->text('body')->nullable();
}
);


//-- UPDATE --
$this->tableUpdate(
function (Blueprint $table) {
if (! $this->hasColumn('from')) {
$table->string('from')->nullable();
}
if (! $this->hasColumn('updated_at')) {
$table->timestamps();
}
if (! $this->hasColumn('updated_by')) {
$table->string('updated_by')->nullable()->after('updated_at');
$table->string('created_by')->nullable()->after('created_at');
}
if (! $this->hasColumn('post_type')) {
$table->nullableMorphs('post');
}

}); //end update
}

//end function up
}

0 comments on commit d6ac651

Please sign in to comment.