2022-06-16 09:56:05 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
2022-06-16 13:33:44 +00:00
|
|
|
class UpdateUserCreditsDatatype extends Migration
|
2022-06-16 09:56:05 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::table('users', function (Blueprint $table) {
|
2022-06-16 13:33:44 +00:00
|
|
|
$table->decimal('credits', 15, 4)->default(0)->change();
|
2022-06-16 09:56:05 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::table('users', function (Blueprint $table) {
|
|
|
|
$table->unsignedFloat('credits')->default(250)->change();
|
2022-06-16 13:33:44 +00:00
|
|
|
|
2022-06-16 09:56:05 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|