mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-06 18:02:42 +00:00
Prep for solid multi-currency configuration.
This commit is contained in:
42
database/migrations/2017_06_02_105232_changes_for_v450.php
Normal file
42
database/migrations/2017_06_02_105232_changes_for_v450.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ChangesForV450
|
||||||
|
*/
|
||||||
|
class ChangesForV450 extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
// add "foreign_amount" to transactions
|
||||||
|
Schema::table(
|
||||||
|
'transactions', function (Blueprint $table) {
|
||||||
|
$table->decimal('foreign_amount', 22, 12)->after('amount');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// add foreign transaction currency id to transactions (is nullable):
|
||||||
|
Schema::table(
|
||||||
|
'transactions', function (Blueprint $table) {
|
||||||
|
$table->integer('foreign_currency_id', false, true)->after('foreign_amount')->nullable();
|
||||||
|
$table->foreign('foreign_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user