mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
added indexes to the database
This commit is contained in:
@@ -14,9 +14,9 @@ class CreateUsersTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->uuid('id')->primary()->index();
|
||||
$table->enum('role', ['admin', 'user'])->default('user');
|
||||
$table->string('email')->unique();
|
||||
$table->string('email')->unique()->index();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
|
||||
@@ -14,8 +14,8 @@ class CreateFileManagerFolders extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('folders', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->uuid('user_id');
|
||||
$table->uuid('id')->primary()->index();
|
||||
$table->uuid('user_id')->index();
|
||||
$table->uuid('parent_id')->nullable();
|
||||
$table->text('name');
|
||||
$table->string('color')->nullable();
|
||||
|
||||
@@ -14,15 +14,15 @@ class CreateFileManagerFiles extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('files', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->uuid('user_id');
|
||||
$table->uuid('id')->primary()->index();
|
||||
$table->uuid('user_id')->index();
|
||||
$table->uuid('folder_id')->nullable();
|
||||
|
||||
$table->text('thumbnail')->nullable();
|
||||
$table->text('name');
|
||||
$table->text('basename');
|
||||
|
||||
$table->text('mimetype')->nullable();
|
||||
$table->text('mimetype')->nullable()->index();
|
||||
$table->text('filesize');
|
||||
|
||||
$table->text('type')->nullable();
|
||||
|
||||
@@ -17,7 +17,7 @@ class CreateSharesTable extends Migration
|
||||
$table->uuid('id')->primary();
|
||||
$table->uuid('user_id');
|
||||
$table->uuid('item_id');
|
||||
$table->string('token', 16)->unique();
|
||||
$table->string('token', 16)->unique()->index();
|
||||
$table->enum('type', ['file', 'folder']);
|
||||
$table->enum('permission', ['visitor', 'editor'])->nullable();
|
||||
$table->boolean('is_protected')->default(0);
|
||||
|
||||
@@ -14,7 +14,7 @@ class CreateUserSettingsTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('user_settings', function (Blueprint $table) {
|
||||
$table->uuid('user_id');
|
||||
$table->uuid('user_id')->index();
|
||||
$table->integer('storage_capacity')->default(5);
|
||||
$table->string('avatar')->nullable();
|
||||
$table->text('name')->nullable();
|
||||
|
||||
@@ -14,7 +14,7 @@ class CreateSettingsTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('settings', function (Blueprint $table) {
|
||||
$table->string('name')->unique()->primary();
|
||||
$table->string('name')->unique()->primary()->index();
|
||||
$table->longText('value')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class CreatePagesTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pages', function (Blueprint $table) {
|
||||
$table->string('slug');
|
||||
$table->string('slug')->index();
|
||||
$table->string('title');
|
||||
$table->boolean('visibility');
|
||||
$table->longText('content');
|
||||
|
||||
@@ -15,7 +15,7 @@ class CreateTrafficTable extends Migration
|
||||
{
|
||||
Schema::create('traffic', function (Blueprint $table) {
|
||||
$table->uuid('id');
|
||||
$table->uuid('user_id');
|
||||
$table->uuid('user_id')->index();
|
||||
$table->bigInteger('upload')->default(0);
|
||||
$table->bigInteger('download')->default(0);
|
||||
$table->timestamps();
|
||||
|
||||
@@ -14,9 +14,9 @@ class CreateZipsTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('zips', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->uuid('user_id');
|
||||
$table->string('shared_token')->nullable();
|
||||
$table->uuid('id')->primary()->index();
|
||||
$table->uuid('user_id')->index();
|
||||
$table->string('shared_token')->nullable()->index();
|
||||
$table->text('basename');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
@@ -6,8 +6,6 @@ use App\Http\Controllers\User\PaymentMethodsController;
|
||||
use App\Http\Controllers\User\SubscriptionController;
|
||||
|
||||
Route::post('/check', [AuthController::class, 'check_account']);
|
||||
Route::post('/register', [AuthController::class, 'register']);
|
||||
Route::post('/login', [AuthController::class, 'login']);
|
||||
|
||||
Route::group(['middleware' => ['auth:sanctum']], function () {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user