mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Properly setup Mount model, add database migration, get mount admin page added
This commit is contained in:
48
database/migrations/2020_05_20_234655_add_mounts_table.php
Normal file
48
database/migrations/2020_05_20_234655_add_mounts_table.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddMountsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('mounts', function (Blueprint $table) {
|
||||
$table->char('id', 36)->unique();
|
||||
$table->string('name');
|
||||
$table->text('description')->nullable();
|
||||
$table->string('source');
|
||||
$table->string('target');
|
||||
$table->tinyInteger('read_only')->unsigned();
|
||||
$table->tinyInteger('user_mountable')->unsigned();
|
||||
});
|
||||
|
||||
Schema::create('egg_mount', function (Blueprint $table) {
|
||||
$table->increments('egg_id')->unique();
|
||||
$table->char('mount_id', 36)->unique();
|
||||
});
|
||||
|
||||
Schema::create('mount_node', function (Blueprint $table) {
|
||||
$table->increments('node_id')->unique();
|
||||
$table->char('mount_id', 36)->unique();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('mount_node');
|
||||
Schema::dropIfExists('egg_mount');
|
||||
Schema::dropIfExists('mounts');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user