updated mediable package
This commit is contained in:
@ -311,37 +311,13 @@ class CoreV1 extends Migration
|
||||
});
|
||||
|
||||
// Media
|
||||
Schema::create('media', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('disk', 32);
|
||||
$table->string('directory', 68);
|
||||
$table->string('filename', 121);
|
||||
$table->string('extension', 28);
|
||||
$table->string('mime_type', 128);
|
||||
$table->string('aggregate_type', 32);
|
||||
$table->integer('size')->unsigned();
|
||||
$table->timestamps();
|
||||
Schema::table('media', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
|
||||
$table->index(['disk', 'directory']);
|
||||
$table->index('aggregate_type');
|
||||
$table->unique(['disk', 'directory', 'filename', 'extension', 'deleted_at']);
|
||||
});
|
||||
|
||||
Schema::create('mediables', function (Blueprint $table) {
|
||||
$table->integer('media_id')->unsigned();
|
||||
$table->string('mediable_type', 152);
|
||||
$table->integer('mediable_id')->unsigned();
|
||||
$table->string('tag', 68);
|
||||
$table->integer('order')->unsigned();
|
||||
|
||||
$table->primary(['media_id', 'mediable_type', 'mediable_id', 'tag']);
|
||||
$table->index(['mediable_id', 'mediable_type']);
|
||||
$table->index('tag');
|
||||
$table->index('order');
|
||||
$table->foreign('media_id')->references('id')->on('media')->onDelete('cascade');
|
||||
});
|
||||
|
||||
// Modules
|
||||
Schema::create('modules', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
Reference in New Issue
Block a user