diff --git a/database/migrations/2022_06_16_092704_add_billing_period_to_products.php b/database/migrations/2022_06_16_092704_add_billing_period_to_products.php index 708e6e5e..ceed9362 100644 --- a/database/migrations/2022_06_16_092704_add_billing_period_to_products.php +++ b/database/migrations/2022_06_16_092704_add_billing_period_to_products.php @@ -16,6 +16,9 @@ class AddBillingPeriodToProducts extends Migration { Schema::table('products', function (Blueprint $table) { $table->string('billing_period')->default("hourly"); + $table->decimal('price', 15, 4)->change(); + $table->decimal('minimum_credits', 15, 4)->change(); + }); DB::statement('UPDATE products SET billing_period="hourly"'); @@ -38,6 +41,8 @@ class AddBillingPeriodToProducts extends Migration { Schema::table('products', function (Blueprint $table) { $table->dropColumn('billing_period'); + $table->decimal('price', 10, 0)->change(); + $table->float('minimum_credits')->change(); }); } } diff --git a/database/migrations/2022_06_16_094402_update_user_price_datatype.php b/database/migrations/2022_06_16_094402_update_user_credits_datatype.php similarity index 82% rename from database/migrations/2022_06_16_094402_update_user_price_datatype.php rename to database/migrations/2022_06_16_094402_update_user_credits_datatype.php index 9b4abb9e..ed5922e8 100644 --- a/database/migrations/2022_06_16_094402_update_user_price_datatype.php +++ b/database/migrations/2022_06_16_094402_update_user_credits_datatype.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class UpdateUserPriceDatatype extends Migration +class UpdateUserCreditsDatatype extends Migration { /** * Run the migrations. @@ -14,7 +14,7 @@ class UpdateUserPriceDatatype extends Migration public function up() { Schema::table('users', function (Blueprint $table) { - $table->decimal('credits', 20, 10)->default(0)->change(); + $table->decimal('credits', 15, 4)->default(0)->change(); }); } @@ -27,6 +27,7 @@ class UpdateUserPriceDatatype extends Migration { Schema::table('users', function (Blueprint $table) { $table->unsignedFloat('credits')->default(250)->change(); + }); } }