Add soft deletes.

This commit is contained in:
James Cole
2014-12-06 17:37:05 +01:00
parent cc111d14b0
commit d774cde109
8 changed files with 13 additions and 6 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);
} }
); );

View File

@@ -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();

View File

@@ -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();

View File

@@ -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']);

View File

@@ -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');
}); }
);
} }
} }