Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration convert laravel 11 migration structure #5878

Open
wants to merge 1 commit into
base: 1.7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"require": {
"php": "^7.3|^7.4|^8.0|^8.1|^8.2",
"illuminate/support": "~8.0|~9.0|~10.0",
"illuminate/support": "~8.0|~9.0|~10.0|~11.0",
"intervention/image": "^2.7",
"doctrine/dbal": "^3.1|^3.5",
"laravel/ui": ">=1.0",
Expand All @@ -31,7 +31,7 @@
"require-dev": {
"phpunit/phpcov": ">=6.0",
"phpunit/phpunit": ">=8.0",
"laravel/framework": "~8.0|~9.0|~10.0",
"laravel/framework": "~8.0|~9.0|~10.0|~11.0",
"orchestra/testbench": ">=6.0",
"laravel/browser-kit-testing": ">=6.1.0",
"orchestra/testbench-browser-kit": ">=4.0"
Expand Down
9 changes: 5 additions & 4 deletions migrations/2016_01_01_000000_add_voyager_user_fields.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;

class AddVoyagerUserFields extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('users', function ($table) {
if (!Schema::hasColumn('users', 'avatar')) {
Expand All @@ -20,7 +21,7 @@ public function up()
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
if (Schema::hasColumn('users', 'avatar')) {
Schema::table('users', function ($table) {
Expand All @@ -33,4 +34,4 @@ public function down()
});
}
}
}
};
13 changes: 5 additions & 8 deletions migrations/2016_01_01_000000_create_data_types_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDataTypesTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
// Create table for storing roles
Schema::create('data_types', function (Blueprint $table) {
Expand Down Expand Up @@ -48,12 +47,10 @@ public function up()

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::drop('data_rows');
Schema::drop('data_types');
}
}
};
13 changes: 5 additions & 8 deletions migrations/2016_05_19_173453_create_menu_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMenuTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('menus', function (Blueprint $table) {
$table->increments('id');
Expand Down Expand Up @@ -38,12 +37,10 @@ public function up()

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::drop('menu_items');
Schema::drop('menus');
}
}
};
12 changes: 4 additions & 8 deletions migrations/2016_10_21_190000_create_roles_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRolesTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('roles', function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -23,11 +21,9 @@ public function up()

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::drop('roles');
}
}
};
12 changes: 4 additions & 8 deletions migrations/2016_10_21_190000_create_settings_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSettingsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('settings', function (Blueprint $table) {
$table->increments('id');
Expand All @@ -26,11 +24,9 @@ public function up()

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('settings');
}
}
};
12 changes: 4 additions & 8 deletions migrations/2016_11_30_135954_create_permission_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePermissionTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('permissions', function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -23,11 +21,9 @@ public function up()

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('permissions');
}
}
};
12 changes: 4 additions & 8 deletions migrations/2016_11_30_141208_create_permission_role_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePermissionRoleTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('permission_role', function (Blueprint $table) {
$table->bigInteger('permission_id')->unsigned()->index();
Expand All @@ -24,11 +22,9 @@ public function up()

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('permission_role');
}
}
};
12 changes: 4 additions & 8 deletions migrations/2016_12_26_201236_data_types__add__server_side.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class DataTypesAddServerSide extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table('data_types', function (Blueprint $table) {
$table->tinyInteger('server_side')->default(0)->after('generate_permissions');
Expand All @@ -20,13 +18,11 @@ public function up()

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::table('data_types', function (Blueprint $table) {
$table->dropColumn('server_side');
});
}
}
};
12 changes: 4 additions & 8 deletions migrations/2017_01_13_000000_add_route_to_menu_items_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddRouteToMenuItemsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table('menu_items', function (Blueprint $table) {
$table->string('route')->nullable()->default(null);
Expand All @@ -21,10 +19,8 @@ public function up()

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
if (Schema::hasColumn('menu_items', 'route')) {
Schema::table('menu_items', function (Blueprint $table) {
Expand All @@ -38,4 +34,4 @@ public function down()
});
}
}
}
};
12 changes: 4 additions & 8 deletions migrations/2017_01_14_005015_create_translations_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTranslationsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('translations', function (Blueprint $table) {
$table->increments('id');
Expand All @@ -31,11 +29,9 @@ public function up()

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('translations');
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class MakeTableNameNullableInPermissionsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table('permissions', function (Blueprint $table) {
$table->string('table_name')->nullable()->default(null)->change();
Expand All @@ -20,11 +18,9 @@ public function up()

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
//

}
}
};
Loading