PATH:
home
/
centosnipponia
/
public_html
/
ts
/
database
/
migrations
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreatePermissionTables extends Migration { /** * Run the migrations. * * @return void */ public function up() { $tableNames = config('permission.table_names'); $columnNames = config('permission.column_names'); if (empty($tableNames)) { throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding.'); } Schema::create($tableNames['permissions'], function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); $table->string('guard_name'); $table->timestamps(); }); Schema::create($tableNames['roles'], function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); $table->string('guard_name'); $table->timestamps(); }); Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) { $table->unsignedBigInteger('permission_id'); $table->string('model_type'); $table->unsignedBigInteger($columnNames['model_morph_key']); $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index'); $table->foreign('permission_id') ->references('id') ->on($tableNames['permissions']) ->onDelete('cascade'); $table->primary(['permission_id', $columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_permission_model_type_primary'); }); Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) { $table->unsignedBigInteger('role_id'); $table->string('model_type'); $table->unsignedBigInteger($columnNames['model_morph_key']); $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index'); $table->foreign('role_id') ->references('id') ->on($tableNames['roles']) ->onDelete('cascade'); $table->primary(['role_id', $columnNames['model_morph_key'], 'model_type'], 'model_has_roles_role_model_type_primary'); }); Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { $table->unsignedBigInteger('permission_id'); $table->unsignedBigInteger('role_id'); $table->foreign('permission_id') ->references('id') ->on($tableNames['permissions']) ->onDelete('cascade'); $table->foreign('role_id') ->references('id') ->on($tableNames['roles']) ->onDelete('cascade'); $table->primary(['permission_id', 'role_id'], 'role_has_permissions_permission_id_role_id_primary'); }); app('cache') ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null) ->forget(config('permission.cache.key')); } /** * Reverse the migrations. * * @return void */ public function down() { $tableNames = config('permission.table_names'); if (empty($tableNames)) { throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.'); } Schema::drop($tableNames['role_has_permissions']); Schema::drop($tableNames['model_has_roles']); Schema::drop($tableNames['model_has_permissions']); Schema::drop($tableNames['roles']); Schema::drop($tableNames['permissions']); } }
[+]
..
[-] 2014_10_12_000000_create_users_table.php
[edit]
[-] 2014_10_12_100000_create_password_resets_table.php
[edit]
[-] 2016_06_01_000001_create_oauth_auth_codes_table.php
[edit]
[-] 2016_06_01_000002_create_oauth_access_tokens_table.php
[edit]
[-] 2016_06_01_000003_create_oauth_refresh_tokens_table.php
[edit]
[-] 2016_06_01_000004_create_oauth_clients_table.php
[edit]
[-] 2016_06_01_000005_create_oauth_personal_access_clients_table.php
[edit]
[-] 2019_08_19_000000_create_failed_jobs_table.php
[edit]
[-] 2020_03_09_135529_create_permission_tables.php
[edit]
[-] 2022_07_11_065611_models_table.php
[edit]
[-] 2022_07_11_065629_countries_table.php
[edit]
[-] 2022_07_11_071328_relations_table.php
[edit]
[-] 2022_07_14_085446_add_locale_to_users_table.php
[edit]
[-] 2022_07_11_065023_add_is_a_claim_to_support_cases_table.php
[edit]
[-] 2022_07_20_095733_add_mypic_to_users_table.php
[edit]
[-] 2022_07_20_130701_case_status.php
[edit]
[-] 2022_07_21_120420_issues_categories.php
[edit]
[-] 2022_07_29_163136_create_ms_graph_tokens_table.php
[edit]
[-] 2022_07_15_201249_messages.php
[edit]
[-] 2022_09_16_071754_create_technical_directives_table.php
[edit]
[-] 2022_09_16_205314_read_state.php
[edit]
[-] 2022_09_20_124551_add_next_order_reminder.php
[edit]
[-] 2022_07_04_113843_create_support_cases_table.php
[edit]
[-] 2022_10_22_190718_add_messagemailto_to_messages_table.php
[edit]
[-] 2022_10_27_124846_create_motos_vins_table.php
[edit]
[-] 2022_10_31_104447_create_vin_to_cases_table.php
[edit]
[-] 2022_11_14_094449_add_distance_to_vin_to_cases_table.php
[edit]
[-] 2023_05_01_011347_update_technical_directives_table.php
[edit]
[-] 2023_05_01_013101_create_directive_model_pivot_table.php
[edit]
[-] 2023_05_24_104218_create_directive_country_pivot_table.php
[edit]
[-] 2023_06_22_102741_rename_directive_file_column.php
[edit]
[-] 2023_06_27_074102_add_model_to_technical_directives_table.php
[edit]
[-] 2023_07_03_111717_change_cases_table.php
[edit]
[-] 2023_07_05_102716_change_vins_table.php
[edit]
[-] 2023_07_05_113211_add_foreign_keys_to_vins_cases.php
[edit]
[-] 2023_07_10_072033_create_jobs_table.php
[edit]
[-] 2023_07_17_070218_add_categorization_to_technical_cases_table.php
[edit]
[-] 2023_07_18_070340_add_country_id_to_tables.php
[edit]
[-] .htaccess.disabled
[edit]