Differential D2239 Diff 6475 src/database/migrations/2021_02_23_084157_payment_table_add_currency_columns.php
Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2021_02_23_084157_payment_table_add_currency_columns.php
- This file was added.
<?php | |||||
use Illuminate\Database\Migrations\Migration; | |||||
use Illuminate\Database\Schema\Blueprint; | |||||
use Illuminate\Support\Facades\Schema; | |||||
class PaymentTableAddCurrencyColumns extends Migration | |||||
{ | |||||
/** | |||||
* Run the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function up() | |||||
{ | |||||
Schema::table( | |||||
'payments', | |||||
function (Blueprint $table) { | |||||
$table->string('currency')->nullable(); | |||||
$table->integer('amountInCurrency')->nullable(); | |||||
} | |||||
); | |||||
} | |||||
machniak: Should we make an update query to fill the new columns with proper data? | |||||
Done Inline ActionsNot sure if necessary, but I suppose would make future queries simpler? mollekopf: Not sure if necessary, but I suppose would make future queries simpler?
Just fill with… | |||||
Done Inline ActionsYes. machniak: Yes. | |||||
/** | |||||
* Reverse the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function down() | |||||
{ | |||||
Schema::table( | |||||
'payments', | |||||
function (Blueprint $table) { | |||||
$table->dropColumn('currency'); | |||||
$table->dropColumn('amountInCurrency'); | |||||
} | |||||
); | |||||
} | |||||
} |
Should we make an update query to fill the new columns with proper data?