改进 迁移
This commit is contained in:
parent
c6d943291a
commit
cfae9acb42
@ -15,8 +15,8 @@ public function up(): void
|
|||||||
{
|
{
|
||||||
Schema::table('hosts', function (Blueprint $table) {
|
Schema::table('hosts', function (Blueprint $table) {
|
||||||
// 将 price 和 managed_price 改成 decimal
|
// 将 price 和 managed_price 改成 decimal
|
||||||
$table->decimal('price')->change();
|
$table->decimal('price', 10)->change();
|
||||||
$table->decimal('managed_price')->change();
|
$table->decimal('managed_price', 10)->change();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up(): void
|
|
||||||
{
|
|
||||||
Schema::table('users', function (Blueprint $table) {
|
|
||||||
$table->decimal('balance')->default(0)->change();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::table('users', function (Blueprint $table) {
|
|
||||||
$table->decimal('balance', 10)->default(0)->change();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
Loading…
Reference in New Issue
Block a user