mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
Migration refactoring
This commit is contained in:
48
.env.testing
Normal file
48
.env.testing
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
APP_NAME=Laravel
|
||||||
|
APP_ENV=testing
|
||||||
|
APP_KEY=base64:47yorkyoH3qCrKKO4eG6LpZUogoTC51qey5vYq/O3AM=
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_URL=http://localhost
|
||||||
|
|
||||||
|
LOG_CHANNEL=stack
|
||||||
|
|
||||||
|
DB_CONNECTION=sqlite
|
||||||
|
DB_HOST=null
|
||||||
|
DB_PORT=null
|
||||||
|
DB_DATABASE=database/test.sqlite
|
||||||
|
DB_USERNAME=null
|
||||||
|
DB_PASSWORD=null
|
||||||
|
|
||||||
|
BROADCAST_DRIVER=log
|
||||||
|
CACHE_DRIVER=file
|
||||||
|
SESSION_DRIVER=file
|
||||||
|
SESSION_LIFETIME=120
|
||||||
|
SCOUT_DRIVER=tntsearch
|
||||||
|
|
||||||
|
REDIS_HOST=127.0.0.1
|
||||||
|
REDIS_PASSWORD=null
|
||||||
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
MAIL_MAILER=log
|
||||||
|
MAIL_HOST=smtp.mailtrap.io
|
||||||
|
MAIL_PORT=2525
|
||||||
|
MAIL_USERNAME=null
|
||||||
|
MAIL_PASSWORD=null
|
||||||
|
MAIL_ENCRYPTION=null
|
||||||
|
MAIL_FROM_ADDRESS=null
|
||||||
|
MAIL_FROM_NAME="${APP_NAME}"
|
||||||
|
|
||||||
|
AWS_ACCESS_KEY_ID=
|
||||||
|
AWS_SECRET_ACCESS_KEY=
|
||||||
|
AWS_DEFAULT_REGION=us-east-1
|
||||||
|
AWS_BUCKET=
|
||||||
|
|
||||||
|
PUSHER_APP_ID=
|
||||||
|
PUSHER_APP_KEY=
|
||||||
|
PUSHER_APP_SECRET=
|
||||||
|
PUSHER_APP_CLUSTER=mt1
|
||||||
|
|
||||||
|
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||||
|
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||||
|
|
||||||
|
SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,127.0.0.1:8000,::1
|
||||||
@@ -2,11 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Http;
|
namespace App\Http;
|
||||||
|
|
||||||
use App\Http\Middleware\AdminCheck;
|
|
||||||
use App\Http\Middleware\CookieAuth;
|
|
||||||
use App\Http\Middleware\LastCheck;
|
|
||||||
use App\Http\Middleware\SharedAuth;
|
|
||||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||||
|
use Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful;
|
||||||
|
|
||||||
class Kernel extends HttpKernel
|
class Kernel extends HttpKernel
|
||||||
{
|
{
|
||||||
@@ -43,6 +40,7 @@ class Kernel extends HttpKernel
|
|||||||
],
|
],
|
||||||
|
|
||||||
'api' => [
|
'api' => [
|
||||||
|
EnsureFrontendRequestsAreStateful::class,
|
||||||
\App\Http\Middleware\EncryptCookies::class,
|
\App\Http\Middleware\EncryptCookies::class,
|
||||||
//'throttle:60,1',
|
//'throttle:60,1',
|
||||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
@@ -57,39 +55,14 @@ class Kernel extends HttpKernel
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $routeMiddleware = [
|
protected $routeMiddleware = [
|
||||||
'auth.master' => CookieAuth::class,
|
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||||
'auth.shared' => SharedAuth::class,
|
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||||
'auth.admin' => AdminCheck::class,
|
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
|
||||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
|
||||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
|
||||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
|
||||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||||
'scopes' => \Laravel\Passport\Http\Middleware\CheckScopes::class,
|
|
||||||
'scope' => \Laravel\Passport\Http\Middleware\CheckForAnyScope::class,
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The priority-sorted list of middleware.
|
|
||||||
*
|
|
||||||
* This forces non-global middleware to always be in the given order.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $middlewarePriority = [
|
|
||||||
\Illuminate\Session\Middleware\StartSession::class,
|
|
||||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
|
||||||
CookieAuth::class,
|
|
||||||
SharedAuth::class,
|
|
||||||
\App\Http\Middleware\Authenticate::class,
|
|
||||||
\Illuminate\Routing\Middleware\ThrottleRequests::class,
|
|
||||||
\Illuminate\Session\Middleware\AuthenticateSession::class,
|
|
||||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
|
||||||
\Illuminate\Auth\Middleware\Authorize::class,
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,13 @@ class CreateUsersTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('users', function (Blueprint $table) {
|
Schema::create('users', function (Blueprint $table) {
|
||||||
$table->bigIncrements('id');
|
$table->uuid('id');
|
||||||
|
$table->enum('role', ['admin', 'user'])->default('user');
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
|
$table->string('avatar')->nullable();
|
||||||
$table->string('email')->unique();
|
$table->string('email')->unique();
|
||||||
$table->timestamp('email_verified_at')->nullable();
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
$table->string('password');
|
$table->string('password');
|
||||||
$table->string('avatar')->nullable();
|
|
||||||
$table->rememberToken();
|
$table->rememberToken();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class CreateOauthAuthCodesTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::create('oauth_auth_codes', function (Blueprint $table) {
|
|
||||||
$table->string('id', 100)->primary();
|
|
||||||
$table->unsignedBigInteger('user_id')->index();
|
|
||||||
$table->unsignedBigInteger('client_id');
|
|
||||||
$table->text('scopes')->nullable();
|
|
||||||
$table->boolean('revoked');
|
|
||||||
$table->dateTime('expires_at')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('oauth_auth_codes');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class CreateOauthAccessTokensTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::create('oauth_access_tokens', function (Blueprint $table) {
|
|
||||||
$table->string('id', 100)->primary();
|
|
||||||
$table->unsignedBigInteger('user_id')->nullable()->index();
|
|
||||||
$table->unsignedBigInteger('client_id');
|
|
||||||
$table->string('name')->nullable();
|
|
||||||
$table->text('scopes')->nullable();
|
|
||||||
$table->boolean('revoked');
|
|
||||||
$table->timestamps();
|
|
||||||
$table->dateTime('expires_at')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('oauth_access_tokens');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class CreateOauthRefreshTokensTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
|
|
||||||
$table->string('id', 100)->primary();
|
|
||||||
$table->string('access_token_id', 100);
|
|
||||||
$table->boolean('revoked');
|
|
||||||
$table->dateTime('expires_at')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('oauth_refresh_tokens');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class CreateOauthClientsTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::create('oauth_clients', function (Blueprint $table) {
|
|
||||||
$table->bigIncrements('id');
|
|
||||||
$table->unsignedBigInteger('user_id')->nullable()->index();
|
|
||||||
$table->string('name');
|
|
||||||
$table->string('secret', 100)->nullable();
|
|
||||||
$table->text('redirect');
|
|
||||||
$table->boolean('personal_access_client');
|
|
||||||
$table->boolean('password_client');
|
|
||||||
$table->boolean('revoked');
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('oauth_clients');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class CreateOauthPersonalAccessClientsTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
|
|
||||||
$table->bigIncrements('id');
|
|
||||||
$table->unsignedBigInteger('client_id');
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('oauth_personal_access_clients');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -15,7 +15,7 @@ class CreateSubscriptionsTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('subscriptions', function (Blueprint $table) {
|
Schema::create('subscriptions', function (Blueprint $table) {
|
||||||
$table->bigIncrements('id');
|
$table->bigIncrements('id');
|
||||||
$table->unsignedBigInteger('user_id');
|
$table->uuid('user_id');
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('stripe_id');
|
$table->string('stripe_id');
|
||||||
$table->string('stripe_status');
|
$table->string('stripe_status');
|
||||||
|
|||||||
@@ -13,15 +13,14 @@ class CreateFileManagerFolders extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('file_manager_folders', function (Blueprint $table) {
|
Schema::create('folders', function (Blueprint $table) {
|
||||||
|
$table->uuid('id')->primary();
|
||||||
$table->bigIncrements('id');
|
$table->uuid('user_id');
|
||||||
$table->integer('unique_id');
|
$table->uuid('parent_id');
|
||||||
$table->integer('parent_id')->default(0);
|
$table->text('name');
|
||||||
|
$table->string('color')->nullable();
|
||||||
$table->text('name')->nullable();
|
$table->string('emoji')->nullable();
|
||||||
$table->text('type')->nullable();
|
$table->enum('user_scope', ['master', 'editor', 'visitor'])->default('master');
|
||||||
|
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,20 +13,21 @@ class CreateFileManagerFiles extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('file_manager_files', function (Blueprint $table) {
|
Schema::create('files', function (Blueprint $table) {
|
||||||
|
$table->uuid('id')->primary();
|
||||||
$table->bigIncrements('id');
|
$table->uuid('user_id');
|
||||||
$table->integer('unique_id');
|
$table->uuid('folder_id');
|
||||||
$table->integer('folder_id')->default(0);
|
|
||||||
|
|
||||||
$table->text('thumbnail')->nullable();
|
$table->text('thumbnail')->nullable();
|
||||||
$table->text('name')->nullable();
|
$table->text('name');
|
||||||
$table->text('basename')->nullable();
|
$table->text('basename');
|
||||||
|
|
||||||
$table->text('mimetype')->nullable();
|
$table->text('mimetype')->nullable();
|
||||||
$table->text('filesize')->nullable();
|
$table->text('filesize');
|
||||||
|
|
||||||
$table->text('type')->nullable();
|
$table->text('type')->nullable();
|
||||||
|
$table->longText('metadata')->nullable();
|
||||||
|
$table->enum('user_scope', ['master', 'editor', 'visitor'])->default('master');
|
||||||
|
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddUserIdToFileManagerFilesTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_files', function (Blueprint $table) {
|
|
||||||
$table->bigInteger('user_id')->after('id')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_files', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddUserIdToFileManagerFoldersTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_folders', function (Blueprint $table) {
|
|
||||||
$table->bigInteger('user_id')->after('id')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_folders', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,8 +14,8 @@ class CreateFavouritesFoldersTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('favourite_folder', function (Blueprint $table) {
|
Schema::create('favourite_folder', function (Blueprint $table) {
|
||||||
$table->bigInteger('user_id');
|
$table->uuid('user_id');
|
||||||
$table->bigInteger('folder_unique_id');
|
$table->uuid('folder_id');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,14 +14,15 @@ class CreateSharesTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('shares', function (Blueprint $table) {
|
Schema::create('shares', function (Blueprint $table) {
|
||||||
$table->bigIncrements('id');
|
$table->uuid('id')->primary();
|
||||||
$table->bigInteger('user_id');
|
$table->uuid('user_id');
|
||||||
$table->string('token', 16)->unique();
|
$table->string('token', 16)->unique();
|
||||||
$table->bigInteger('item_id');
|
$table->uuid('item_id');
|
||||||
$table->enum('type', ['file', 'files', 'folder']);
|
$table->enum('type', ['file', 'folder']);
|
||||||
$table->enum('permission', ['visitor', 'editor'])->nullable();
|
$table->enum('permission', ['visitor', 'editor'])->nullable();
|
||||||
$table->boolean('protected');
|
$table->boolean('is_protected')->default(0);
|
||||||
$table->string('password')->nullable();
|
$table->string('password')->nullable();
|
||||||
|
$table->integer('expire_in')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddUserScopeToFileManagerFilesTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_files', function (Blueprint $table) {
|
|
||||||
$table->string('user_scope')->after('type')->default('master');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_files', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddUserScopeToFileManagerFoldersTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_folders', function (Blueprint $table) {
|
|
||||||
$table->string('user_scope')->after('type')->default('master');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_folders', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddRoleToUsersTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('users', function (Blueprint $table) {
|
|
||||||
$table->enum('role', ['admin', 'user'])->default('user')->after('id');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('users', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,9 +14,16 @@ class CreateUserSettingsTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('user_settings', function (Blueprint $table) {
|
Schema::create('user_settings', function (Blueprint $table) {
|
||||||
$table->bigIncrements('id');
|
$table->uuid('user_id');
|
||||||
$table->integer('user_id');
|
|
||||||
$table->integer('storage_capacity')->default(5);
|
$table->integer('storage_capacity')->default(5);
|
||||||
|
$table->text('name')->nullable();
|
||||||
|
$table->text('address')->nullable();
|
||||||
|
$table->text('state')->nullable();
|
||||||
|
$table->text('city')->nullable();
|
||||||
|
$table->text('postal_code')->nullable();
|
||||||
|
$table->text('country')->nullable();
|
||||||
|
$table->text('phone_number')->nullable();
|
||||||
|
$table->decimal('timezone', 10, 1)->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddAttributesToUserSettingsTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('user_settings', function (Blueprint $table) {
|
|
||||||
$table->text('billing_name')->nullable();
|
|
||||||
$table->text('billing_address')->nullable();
|
|
||||||
$table->text('billing_state')->nullable();
|
|
||||||
$table->text('billing_city')->nullable();
|
|
||||||
$table->text('billing_postal_code')->nullable();
|
|
||||||
$table->text('billing_country')->nullable();
|
|
||||||
$table->text('billing_phone_number')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('user_settings', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('billing_name');
|
|
||||||
$table->dropColumn('billing_address');
|
|
||||||
$table->dropColumn('billing_state');
|
|
||||||
$table->dropColumn('billing_city');
|
|
||||||
$table->dropColumn('billing_postal_code');
|
|
||||||
$table->dropColumn('billing_country');
|
|
||||||
$table->dropColumn('billing_phone_number');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,7 +14,6 @@ class CreateSettingsTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('settings', function (Blueprint $table) {
|
Schema::create('settings', function (Blueprint $table) {
|
||||||
$table->bigIncrements('id');
|
|
||||||
$table->string('name')->unique();
|
$table->string('name')->unique();
|
||||||
$table->longText('value')->nullable();
|
$table->longText('value')->nullable();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,10 +14,9 @@ class CreatePagesTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('pages', function (Blueprint $table) {
|
Schema::create('pages', function (Blueprint $table) {
|
||||||
$table->id();
|
|
||||||
$table->boolean('visibility');
|
|
||||||
$table->string('title');
|
|
||||||
$table->string('slug');
|
$table->string('slug');
|
||||||
|
$table->string('title');
|
||||||
|
$table->boolean('visibility');
|
||||||
$table->longText('content');
|
$table->longText('content');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddExpirationAtAttributeToSharesTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('shares', function (Blueprint $table) {
|
|
||||||
$table->integer('expire_in')->after('password')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('shares', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddExifDataToFileManagerFilesTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_files', function (Blueprint $table) {
|
|
||||||
$table->longText('metadata')->after('type')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_files', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,8 +14,8 @@ class CreateTrafficTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('traffic', function (Blueprint $table) {
|
Schema::create('traffic', function (Blueprint $table) {
|
||||||
$table->bigIncrements('id');
|
$table->uuid('id');
|
||||||
$table->bigInteger('user_id');
|
$table->uuid('user_id');
|
||||||
$table->bigInteger('upload')->default(0);
|
$table->bigInteger('upload')->default(0);
|
||||||
$table->bigInteger('download')->default(0);
|
$table->bigInteger('download')->default(0);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class CreateZipsTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('zips', function (Blueprint $table) {
|
Schema::create('zips', function (Blueprint $table) {
|
||||||
$table->uuid('id')->primary();
|
$table->uuid('id')->primary();
|
||||||
$table->bigInteger('user_id');
|
$table->uuid('user_id');
|
||||||
$table->string('shared_token')->nullable();
|
$table->string('shared_token')->nullable();
|
||||||
$table->text('basename');
|
$table->text('basename');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddTimezoneToUserSettingsTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('user_settings', function (Blueprint $table) {
|
|
||||||
$table->decimal('timezone', 10, 1)->after('billing_phone_number')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('user_settings', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddFolderIconOptionsToFileManagerFoldersTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_folders', function (Blueprint $table) {
|
|
||||||
$table->string('icon_color')->after('user_scope')->nullable();
|
|
||||||
$table->string('icon_emoji')->after('icon_color')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('file_manager_folders', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user