add nova
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Laravel\Nova\Util;
|
||||
|
||||
class CreateActionEventsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('action_events', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->char('batch_id', 36);
|
||||
$table->foreignIdFor(Util::userModel(), 'user_id')->index();
|
||||
$table->string('name');
|
||||
$table->morphs('actionable');
|
||||
$table->morphs('target');
|
||||
$table->string('model_type');
|
||||
|
||||
if (Builder::$defaultMorphKeyType === 'uuid') {
|
||||
$table->uuid('model_id')->nullable();
|
||||
} elseif (Builder::$defaultMorphKeyType === 'ulid') {
|
||||
$table->ulid('model_id')->nullable();
|
||||
} else {
|
||||
$table->unsignedBigInteger('model_id')->nullable();
|
||||
}
|
||||
|
||||
$table->text('fields');
|
||||
$table->string('status', 25)->default('running');
|
||||
$table->text('exception');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['batch_id', 'model_type', 'model_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('action_events');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsToActionEventsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('action_events', function (Blueprint $table) {
|
||||
$table->mediumText('original')->nullable();
|
||||
$table->mediumText('changes')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('action_events', function (Blueprint $table) {
|
||||
$table->dropColumn('original', 'changes');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateNovaNotificationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('nova_notifications', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->string('type');
|
||||
$table->morphs('notifiable');
|
||||
$table->text('data');
|
||||
$table->timestamp('read_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('nova_notifications');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsToNovaNotificationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('nova_notifications', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropColumns('nova_notifications', ['deleted_at']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFieldAttachmentsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (Schema::hasTable('nova_pending_trix_attachments')) {
|
||||
Schema::rename('nova_pending_trix_attachments', 'nova_pending_field_attachments');
|
||||
} else {
|
||||
Schema::create('nova_pending_field_attachments', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('draft_id')->index();
|
||||
$table->string('attachment');
|
||||
$table->string('disk');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if (Schema::hasTable('nova_trix_attachments')) {
|
||||
Schema::rename('nova_trix_attachments', 'nova_field_attachments');
|
||||
} else {
|
||||
Schema::create('nova_field_attachments', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->morphs('attachable');
|
||||
$table->string('attachment');
|
||||
$table->string('disk');
|
||||
$table->string('url')->index();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('nova_pending_field_attachments');
|
||||
Schema::dropIfExists('nova_field_attachments');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user