fix: 🗃️ settings table migration order
This commit is contained in:
parent
d6573b9bfd
commit
f2a714cece
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->rename('settings_old');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('settings_old', function (Blueprint $table) {
|
||||
$table->rename("settings");
|
||||
});
|
||||
}
|
||||
};
|
|
@ -13,6 +13,12 @@ return new class extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
// rename old settings table
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->rename('settings_old');
|
||||
});
|
||||
|
||||
// create new settings table
|
||||
Schema::create('settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
|
@ -31,5 +37,9 @@ return new class extends Migration
|
|||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('settings');
|
||||
|
||||
Schema::table('settings_old', function (Blueprint $table) {
|
||||
$table->rename("settings");
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -24,10 +24,10 @@ return new class extends Migration
|
|||
public function down()
|
||||
{
|
||||
Schema::create('settings_old', function (Blueprint $table) {
|
||||
$table->string('key', 191);
|
||||
$table->string('key', 191)->primary();
|
||||
$table->text('value')->nullable();
|
||||
$table->string('type');
|
||||
$table->longText('description');
|
||||
$table->longText('description')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue