Skip to content

Firefly III: a personal finances manager

New migration and code cleanup.

James Cole2597633b0e72
diff --git a/app/database/migrations/2014_06_27_163032_create_users_table.php b/app/database/migrations/2014_06_27_163032_create_users_table.php
index 25cc4349a3..7dce4f47b8 100644
--- a/app/database/migrations/2014_06_27_163032_create_users_table.php
+++ b/app/database/migrations/2014_06_27_163032_create_users_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateUsersTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('users');
+ }
+
/**
* Run the migrations.
*
@@ -33,14 +43,4 @@ class CreateUsersTable extends Migration
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('users');
- }
-
}
diff --git a/app/database/migrations/2014_06_27_163145_create_account_types_table.php b/app/database/migrations/2014_06_27_163145_create_account_types_table.php
index b900c47bed..8a05459eaf 100644
--- a/app/database/migrations/2014_06_27_163145_create_account_types_table.php
+++ b/app/database/migrations/2014_06_27_163145_create_account_types_table.php
@@ -29,14 +29,14 @@ class CreateAccountTypesTable extends Migration
public function up()
{
Schema::create(
- 'account_types', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->string('type', 50);
- $table->boolean('editable');
+ 'account_types', function (Blueprint $table) {
+ $table->increments('id');
+ $table->timestamps();
+ $table->string('type', 50);
+ $table->boolean('editable');
- $table->unique('type');
- }
+ $table->unique('type');
+ }
);
}
diff --git a/app/database/migrations/2014_06_27_163259_create_accounts_table.php b/app/database/migrations/2014_06_27_163259_create_accounts_table.php
index e98a4d4581..fb90d43c63 100644
--- a/app/database/migrations/2014_06_27_163259_create_accounts_table.php
+++ b/app/database/migrations/2014_06_27_163259_create_accounts_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateAccountsTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('accounts');
+ }
+
/**
* Run the migrations.
*
@@ -28,28 +38,14 @@ class CreateAccountsTable extends Migration
$table->boolean('active');
// connect accounts to users
- $table->foreign('user_id')
- ->references('id')->on('users')
- ->onDelete('cascade');
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
// connect accounts to account_types
- $table->foreign('account_type_id')
- ->references('id')->on('account_types')
- ->onDelete('cascade');
+ $table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade');
$table->unique(['user_id', 'account_type_id', 'name']);
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('accounts');
- }
-
}
diff --git a/app/database/migrations/2014_06_27_163817_create_components_table.php b/app/database/migrations/2014_06_27_163817_create_components_table.php
index 998bef4ddf..3c213f7d91 100644
--- a/app/database/migrations/2014_06_27_163817_create_components_table.php
+++ b/app/database/migrations/2014_06_27_163817_create_components_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateComponentsTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('components');
+ }
+
/**
* Run the migrations.
*
@@ -27,9 +37,7 @@ class CreateComponentsTable extends Migration
$table->string('class', 20);
// connect components to users
- $table->foreign('user_id')
- ->references('id')->on('users')
- ->onDelete('cascade');
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->unique(['user_id', 'class', 'name']);
}
@@ -37,14 +45,4 @@ class CreateComponentsTable extends Migration
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('components');
- }
-
}
diff --git a/app/database/migrations/2014_06_27_163818_create_piggybanks_table.php b/app/database/migrations/2014_06_27_163818_create_piggybanks_table.php
index 74ff3e20c8..e4f2be8348 100644
--- a/app/database/migrations/2014_06_27_163818_create_piggybanks_table.php
+++ b/app/database/migrations/2014_06_27_163818_create_piggybanks_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreatePiggybanksTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('piggybanks');
+ }
+
/**
* Run the migrations.
*
@@ -37,23 +47,11 @@ class CreatePiggybanksTable extends Migration
$table->integer('order')->unsigned();
// connect account to piggybank.
- $table->foreign('account_id')
- ->references('id')->on('accounts')
- ->onDelete('cascade');
+ $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
$table->unique(['account_id', 'name']);
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('piggybanks');
- }
-
}
diff --git a/app/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php b/app/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php
index 64c82f8491..04e34c4863 100644
--- a/app/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php
+++ b/app/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateTransactionCurrenciesTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('transaction_currencies');
+ }
+
/**
* Run the migrations.
*
@@ -27,14 +37,4 @@ class CreateTransactionCurrenciesTable extends Migration
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('transaction_currencies');
- }
-
}
diff --git a/app/database/migrations/2014_06_27_164512_create_transaction_types_table.php b/app/database/migrations/2014_06_27_164512_create_transaction_types_table.php
index 6cd34a74c5..b50a7e4d08 100644
--- a/app/database/migrations/2014_06_27_164512_create_transaction_types_table.php
+++ b/app/database/migrations/2014_06_27_164512_create_transaction_types_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateTransactionTypesTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('transaction_types');
+ }
+
/**
* Run the migrations.
*
@@ -27,14 +37,4 @@ class CreateTransactionTypesTable extends Migration
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('transaction_types');
- }
-
}
diff --git a/app/database/migrations/2014_06_27_164619_create_recurring_transactions_table.php b/app/database/migrations/2014_06_27_164619_create_recurring_transactions_table.php
index 46b48bc255..af41979983 100644
--- a/app/database/migrations/2014_06_27_164619_create_recurring_transactions_table.php
+++ b/app/database/migrations/2014_06_27_164619_create_recurring_transactions_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateRecurringTransactionsTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('recurring_transactions');
+ }
+
/**
* Run the migrations.
*
@@ -41,14 +51,4 @@ class CreateRecurringTransactionsTable extends Migration
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('recurring_transactions');
- }
-
}
diff --git a/app/database/migrations/2014_06_27_164620_create_transaction_journals_table.php b/app/database/migrations/2014_06_27_164620_create_transaction_journals_table.php
index 75886fa254..5988ea2ab3 100644
--- a/app/database/migrations/2014_06_27_164620_create_transaction_journals_table.php
+++ b/app/database/migrations/2014_06_27_164620_create_transaction_journals_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateTransactionJournalsTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('transaction_journals');
+ }
+
/**
* Run the migrations.
*
@@ -31,36 +41,18 @@ class CreateTransactionJournalsTable extends Migration
$table->date('date');
// connect transaction journals to transaction types
- $table->foreign('transaction_type_id')
- ->references('id')->on('transaction_types')
- ->onDelete('cascade');
+ $table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
// connect transaction journals to recurring transactions
- $table->foreign('recurring_transaction_id')
- ->references('id')->on('recurring_transactions')
- ->onDelete('set null');
+ $table->foreign('recurring_transaction_id')->references('id')->on('recurring_transactions')->onDelete('set null');
// connect transaction journals to transaction currencies
- $table->foreign('transaction_currency_id')
- ->references('id')->on('transaction_currencies')
- ->onDelete('cascade');
+ $table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
// connect users
- $table->foreign('user_id')
- ->references('id')->on('users')
- ->onDelete('cascade');
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('transaction_journals');
- }
-
}
diff --git a/app/database/migrations/2014_06_27_164836_create_transactions_table.php b/app/database/migrations/2014_06_27_164836_create_transactions_table.php
index 9bd7c6177d..4875a57c83 100644
--- a/app/database/migrations/2014_06_27_164836_create_transactions_table.php
+++ b/app/database/migrations/2014_06_27_164836_create_transactions_table.php
@@ -39,19 +39,13 @@ class CreateTransactionsTable extends Migration
$table->decimal('amount', 10, 2);
// connect transactions to transaction journals
- $table->foreign('transaction_journal_id')
- ->references('id')->on('transaction_journals')
- ->onDelete('cascade');
+ $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
// connect piggy banks
- $table->foreign('piggybank_id')
- ->references('id')->on('piggybanks')
- ->onDelete('set null');
+ $table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('set null');
// connect account id:
- $table->foreign('account_id')
- ->references('id')->on('accounts')
- ->onDelete('cascade');
+ $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
}
);
diff --git a/app/database/migrations/2014_06_27_165344_create_component_transaction_table.php b/app/database/migrations/2014_06_27_165344_create_component_transaction_table.php
index 4c3a2c825a..7cbef507ee 100644
--- a/app/database/migrations/2014_06_27_165344_create_component_transaction_table.php
+++ b/app/database/migrations/2014_06_27_165344_create_component_transaction_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateComponentTransactionTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('component_transaction');
+ }
+
/**
* Run the migrations.
*
@@ -25,26 +35,12 @@ class CreateComponentTransactionTable extends Migration
$table->integer('transaction_id')->unsigned();
// connect to components
- $table->foreign('component_id')
- ->references('id')->on('components')
- ->onDelete('cascade');
+ $table->foreign('component_id')->references('id')->on('components')->onDelete('cascade');
// connect to transactions
- $table->foreign('transaction_id')
- ->references('id')->on('transactions')
- ->onDelete('cascade');
+ $table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('component_transaction');
- }
-
}
diff --git a/app/database/migrations/2014_07_05_171326_create_component_transaction_journal_table.php b/app/database/migrations/2014_07_05_171326_create_component_transaction_journal_table.php
index 1d4b9c5f51..b34fbc1aa2 100644
--- a/app/database/migrations/2014_07_05_171326_create_component_transaction_journal_table.php
+++ b/app/database/migrations/2014_07_05_171326_create_component_transaction_journal_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateComponentTransactionJournalTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('component_transaction_journal');
+ }
+
/**
* Run the migrations.
*
@@ -25,26 +35,12 @@ class CreateComponentTransactionJournalTable extends Migration
$table->integer('transaction_journal_id')->unsigned();
// link components with component_id
- $table->foreign('component_id')
- ->references('id')->on('components')
- ->onDelete('cascade');
+ $table->foreign('component_id')->references('id')->on('components')->onDelete('cascade');
// link transaction journals with transaction_journal_id
- $table->foreign('transaction_journal_id')
- ->references('id')->on('transaction_journals')
- ->onDelete('cascade');
+ $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('component_transaction_journal');
- }
-
}
diff --git a/app/database/migrations/2014_07_06_123842_create_preferences_table.php b/app/database/migrations/2014_07_06_123842_create_preferences_table.php
index 9aabb3bbcd..fb74ddd1bc 100644
--- a/app/database/migrations/2014_07_06_123842_create_preferences_table.php
+++ b/app/database/migrations/2014_07_06_123842_create_preferences_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreatePreferencesTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('preferences');
+ }
+
/**
* Run the migrations.
*
@@ -27,21 +37,9 @@ class CreatePreferencesTable extends Migration
$table->text('data');
// connect preferences to users
- $table->foreign('user_id')
- ->references('id')->on('users')
- ->onDelete('cascade');
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('preferences');
- }
-
}
diff --git a/app/database/migrations/2014_07_09_204843_create_session_table.php b/app/database/migrations/2014_07_09_204843_create_session_table.php
index 7e29be1cce..c4423f33cf 100644
--- a/app/database/migrations/2014_07_09_204843_create_session_table.php
+++ b/app/database/migrations/2014_07_09_204843_create_session_table.php
@@ -10,6 +10,16 @@ use Illuminate\Database\Migrations\Migration;
class CreateSessionTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('sessions');
+ }
+
/**
* Run the migrations.
*
@@ -26,14 +36,4 @@ class CreateSessionTable extends Migration
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('sessions');
- }
-
}
diff --git a/app/database/migrations/2014_07_17_183717_create_limits_table.php b/app/database/migrations/2014_07_17_183717_create_limits_table.php
index 0edb4a17c8..fb3dbe3660 100644
--- a/app/database/migrations/2014_07_17_183717_create_limits_table.php
+++ b/app/database/migrations/2014_07_17_183717_create_limits_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateLimitsTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('limits');
+ }
+
/**
* Run the migrations.
*
@@ -31,21 +41,9 @@ class CreateLimitsTable extends Migration
$table->unique(['component_id', 'startdate', 'repeat_freq']);
// connect component
- $table->foreign('component_id')
- ->references('id')->on('components')
- ->onDelete('cascade');
+ $table->foreign('component_id')->references('id')->on('components')->onDelete('cascade');
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('limits');
- }
-
}
diff --git a/app/database/migrations/2014_07_19_055011_create_limit_repeat_table.php b/app/database/migrations/2014_07_19_055011_create_limit_repeat_table.php
index f0578b463a..e69902a3eb 100644
--- a/app/database/migrations/2014_07_19_055011_create_limit_repeat_table.php
+++ b/app/database/migrations/2014_07_19_055011_create_limit_repeat_table.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreateLimitRepeatTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('limit_repetitions');
+ }
+
/**
* Run the migrations.
*
@@ -30,21 +40,9 @@ class CreateLimitRepeatTable extends Migration
$table->unique(['limit_id', 'startdate', 'enddate']);
// connect limit
- $table->foreign('limit_id')
- ->references('id')->on('limits')
- ->onDelete('cascade');
+ $table->foreign('limit_id')->references('id')->on('limits')->onDelete('cascade');
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('limit_repetitions');
- }
-
}
diff --git a/app/database/migrations/2014_08_06_044416_recurring_transactions_to_components.php b/app/database/migrations/2014_08_06_044416_recurring_transactions_to_components.php
index 18a789b4bd..326228af51 100644
--- a/app/database/migrations/2014_08_06_044416_recurring_transactions_to_components.php
+++ b/app/database/migrations/2014_08_06_044416_recurring_transactions_to_components.php
@@ -11,6 +11,16 @@ use Illuminate\Database\Schema\Blueprint;
class RecurringTransactionsToComponents extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('component_recurring_transaction');
+ }
+
/**
* Run the migrations.
*
@@ -26,26 +36,12 @@ class RecurringTransactionsToComponents extends Migration
$table->boolean('optional');
// link components with component_id
- $table->foreign('component_id')
- ->references('id')->on('components')
- ->onDelete('cascade');
+ $table->foreign('component_id')->references('id')->on('components')->onDelete('cascade');
// link transaction journals with transaction_journal_id
- $table->foreign('recurring_transaction_id')
- ->references('id')->on('recurring_transactions')
- ->onDelete('cascade');
+ $table->foreign('recurring_transaction_id')->references('id')->on('recurring_transactions')->onDelete('cascade');
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('component_recurring_transaction');
- }
-
}
diff --git a/app/database/migrations/2014_08_12_173919_create_piggy_instance.php b/app/database/migrations/2014_08_12_173919_create_piggy_instance.php
index c4a0c0ceeb..96dbb1ec06 100644
--- a/app/database/migrations/2014_08_12_173919_create_piggy_instance.php
+++ b/app/database/migrations/2014_08_12_173919_create_piggy_instance.php
@@ -6,6 +6,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreatePiggyInstance extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('piggybank_repetitions');
+ }
+
/**
* Run the migrations.
*
@@ -25,21 +35,9 @@ class CreatePiggyInstance extends Migration
$table->unique(['piggybank_id', 'startdate', 'targetdate']);
// connect instance to piggybank.
- $table->foreign('piggybank_id')
- ->references('id')->on('piggybanks')
- ->onDelete('cascade');
+ $table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('cascade');
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('piggybank_repetitions');
- }
-
}
diff --git a/app/database/migrations/2014_08_18_100330_create_piggy_events.php b/app/database/migrations/2014_08_18_100330_create_piggy_events.php
index 3551a6b0d9..6abd680a19 100644
--- a/app/database/migrations/2014_08_18_100330_create_piggy_events.php
+++ b/app/database/migrations/2014_08_18_100330_create_piggy_events.php
@@ -6,6 +6,16 @@ use Illuminate\Database\Schema\Blueprint;
class CreatePiggyEvents extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('piggybank_events');
+ }
+
/**
* Run the migrations.
*
@@ -22,21 +32,9 @@ class CreatePiggyEvents extends Migration
$table->decimal('amount', 10, 2);
// connect instance to piggybank.
- $table->foreign('piggybank_id')
- ->references('id')->on('piggybanks')
- ->onDelete('cascade');
+ $table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('cascade');
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('piggybank_events');
- }
-
}
diff --git a/app/database/migrations/2014_08_23_113221_create_reminders_table.php b/app/database/migrations/2014_08_23_113221_create_reminders_table.php
index 12a04c3b00..bf7ac668b4 100644
--- a/app/database/migrations/2014_08_23_113221_create_reminders_table.php
+++ b/app/database/migrations/2014_08_23_113221_create_reminders_table.php
@@ -33,9 +33,7 @@ class CreateRemindersTable extends Migration
$table->boolean('active');
// connect reminders to users
- $table->foreign('user_id')
- ->references('id')->on('users')
- ->onDelete('cascade');
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
}
diff --git a/app/database/migrations/2014_08_31_153322_create_importmaps_table.php b/app/database/migrations/2014_08_31_153322_create_importmaps_table.php
index c4b68c7b68..5d7eeefcf9 100644
--- a/app/database/migrations/2014_08_31_153322_create_importmaps_table.php
+++ b/app/database/migrations/2014_08_31_153322_create_importmaps_table.php
@@ -1,41 +1,41 @@
<?php
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
-class CreateImportmapsTable extends Migration {
+class CreateImportmapsTable extends Migration
+{
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('importmaps', function(Blueprint $table)
- {
- $table->increments('id');
- $table->timestamps();
- $table->integer('user_id')->unsigned();
- $table->string('file',500);
- $table->integer('totaljobs')->unsigned();
- $table->integer('jobsdone')->unsigned();
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('importmaps');
+ }
- // connect maps to users
- $table->foreign('user_id')
- ->references('id')->on('users')
- ->onDelete('cascade');
- });
- }
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::create(
+ 'importmaps', function (Blueprint $table) {
+ $table->increments('id');
+ $table->timestamps();
+ $table->integer('user_id')->unsigned();
+ $table->string('file', 500);
+ $table->integer('totaljobs')->unsigned();
+ $table->integer('jobsdone')->unsigned();
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('importmaps');
- }
+ // connect maps to users
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
+ }
+ );
+ }
}
diff --git a/app/database/migrations/2014_09_01_052816_create_importentries_table.php b/app/database/migrations/2014_09_01_052816_create_importentries_table.php
index 70cd8e862c..5003dfc9d5 100644
--- a/app/database/migrations/2014_09_01_052816_create_importentries_table.php
+++ b/app/database/migrations/2014_09_01_052816_create_importentries_table.php
@@ -1,11 +1,21 @@
<?php
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
class CreateImportentriesTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('importentries');
+ }
+
/**
* Run the migrations.
*
@@ -23,21 +33,9 @@ class CreateImportentriesTable extends Migration
$table->integer('new')->unsigned();
// connect import map.
- $table->foreign('importmap_id')
- ->references('id')->on('importmaps')
- ->onDelete('cascade');
+ $table->foreign('importmap_id')->references('id')->on('importmaps')->onDelete('cascade');
}
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('importentries');
- }
-
}
diff --git a/app/database/migrations/2014_09_02_103101_create_failed_jobs_table.php b/app/database/migrations/2014_09_02_103101_create_failed_jobs_table.php
index eb0e8e6c12..89cb377e9d 100644
--- a/app/database/migrations/2014_09_02_103101_create_failed_jobs_table.php
+++ b/app/database/migrations/2014_09_02_103101_create_failed_jobs_table.php
@@ -23,13 +23,15 @@ class CreateFailedJobsTable extends Migration
*/
public function up()
{
- Schema::create('failed_jobs', function (Blueprint $table) {
- $table->increments('id');
- $table->text('connection');
- $table->text('queue');
- $table->text('payload');
- $table->timestamp('failed_at');
- });
+ Schema::create(
+ 'failed_jobs', function (Blueprint $table) {
+ $table->increments('id');
+ $table->text('connection');
+ $table->text('queue');
+ $table->text('payload');
+ $table->timestamp('failed_at');
+ }
+ );
}
}
diff --git a/app/database/migrations/2014_11_10_172053_create_account_meta.php b/app/database/migrations/2014_11_10_172053_create_account_meta.php
index 8038f3726f..55281d7748 100644
--- a/app/database/migrations/2014_11_10_172053_create_account_meta.php
+++ b/app/database/migrations/2014_11_10_172053_create_account_meta.php
@@ -1,11 +1,22 @@
<?php
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
class CreateAccountMeta extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ //
+ Schema::drop('account_meta');
+ }
+
/**
* Run the migrations.
*
@@ -27,15 +38,4 @@ class CreateAccountMeta extends Migration
);
}
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- //
- Schema::drop('account_meta');
- }
-
}
diff --git a/app/database/migrations/2014_11_13_062347_expand_reminders_table.php b/app/database/migrations/2014_11_13_062347_expand_reminders_table.php
new file mode 100644
index 0000000000..44274fdb1c
--- /dev/null
+++ b/app/database/migrations/2014_11_13_062347_expand_reminders_table.php
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+
+class ExpandRemindersTable extends Migration
+{
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ //
+ }
+
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table(
+ 'reminders', function ($table) {
+ $table->string('title');
+ $table->text('data');
+ }
+ );
+ }
+
+}
diff --git a/app/database/seeds/DefaultUserSeeder.php b/app/database/seeds/DefaultUserSeeder.php
index 935d507811..88f6759490 100644
--- a/app/database/seeds/DefaultUserSeeder.php
+++ b/app/database/seeds/DefaultUserSeeder.php
@@ -10,13 +10,7 @@ class DefaultUserSeeder extends Seeder
DB::table('users')->delete();
User::create(
- [
- 'email' => '[email protected]',
- 'password' => 'sander',
- 'reset' => null,
- 'remember_token' => null,
- 'migrated' => 0
- ]
+ ['email' => '[email protected]', 'password' => 'sander', 'reset' => null, 'remember_token' => null, 'migrated' => 0]
);
}