mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Add soft deletes.
This commit is contained in:
@@ -32,6 +32,7 @@ class CreateAccountsTable extends Migration
|
|||||||
'accounts', function (Blueprint $table) {
|
'accounts', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->integer('account_type_id')->unsigned();
|
$table->integer('account_type_id')->unsigned();
|
||||||
$table->string('name', 100);
|
$table->string('name', 100);
|
||||||
|
@@ -32,6 +32,7 @@ class CreateComponentsTable extends Migration
|
|||||||
'components', function (Blueprint $table) {
|
'components', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
$table->string('name', 50);
|
$table->string('name', 50);
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->string('class', 20);
|
$table->string('class', 20);
|
||||||
|
@@ -32,6 +32,7 @@ class CreateTransactionTypesTable extends Migration
|
|||||||
'transaction_types', function (Blueprint $table) {
|
'transaction_types', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
$table->string('type', 50);
|
$table->string('type', 50);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@@ -32,6 +32,7 @@ class CreateTransactionJournalsTable extends Migration
|
|||||||
'transaction_journals', function (Blueprint $table) {
|
'transaction_journals', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->integer('transaction_type_id')->unsigned();
|
$table->integer('transaction_type_id')->unsigned();
|
||||||
$table->integer('recurring_transaction_id')->unsigned()->nullable();
|
$table->integer('recurring_transaction_id')->unsigned()->nullable();
|
||||||
|
@@ -32,6 +32,7 @@ class CreateTransactionsTable extends Migration
|
|||||||
'transactions', function (Blueprint $table) {
|
'transactions', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
$table->integer('account_id')->unsigned();
|
$table->integer('account_id')->unsigned();
|
||||||
$table->integer('piggybank_id')->nullable()->unsigned();
|
$table->integer('piggybank_id')->nullable()->unsigned();
|
||||||
$table->integer('transaction_journal_id')->unsigned();
|
$table->integer('transaction_journal_id')->unsigned();
|
||||||
|
@@ -27,6 +27,7 @@ class Transactiongroups extends Migration
|
|||||||
'transaction_groups', function (Blueprint $table) {
|
'transaction_groups', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->enum('relation', ['balance']);
|
$table->enum('relation', ['balance']);
|
||||||
|
|
||||||
|
@@ -35,7 +35,8 @@ class Transactiongroupsjoin extends Migration
|
|||||||
$table->foreign('transaction_journal_id', 'tr_trj_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
$table->foreign('transaction_journal_id', 'tr_trj_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||||
|
|
||||||
$table->unique(['transaction_group_id', 'transaction_journal_id'], 'tt_joined');
|
$table->unique(['transaction_group_id', 'transaction_journal_id'], 'tt_joined');
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user