Compare commits
2 Commits
7eae435a50
...
e78f0a6fae
Author | SHA1 | Date |
---|---|---|
b1ek | e78f0a6fae | |
b1ek | 1f65330a73 |
|
@ -26,7 +26,7 @@ class AddBalance extends Command
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$balance = (int) $this->argument('balance');
|
$balance = (double) $this->argument('balance');
|
||||||
$id = (int) $this->argument('id');
|
$id = (int) $this->argument('id');
|
||||||
if ($balance == 0 || $id == 0) {
|
if ($balance == 0 || $id == 0) {
|
||||||
$this->fail('Balance or Id must be non zero value!');
|
$this->fail('Balance or Id must be non zero value!');
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('balance');
|
||||||
|
$table->double('balance')->default(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('balance');
|
||||||
|
$table->bigInteger('balance')->default(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue