mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Code clean up.
This commit is contained in:
parent
649dca77f5
commit
ef837f20dd
@ -167,7 +167,6 @@ class User extends Authenticatable
|
||||
*/
|
||||
public function hasRole(string $name): bool
|
||||
{
|
||||
|
||||
foreach ($this->roles as $role) {
|
||||
if ($role->name === $name) {
|
||||
return true;
|
||||
@ -262,6 +261,4 @@ class User extends Authenticatable
|
||||
{
|
||||
return $this->hasManyThrough('FireflyIII\Models\Transaction', 'FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ declare(strict_types=1);
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model Factories
|
||||
@ -25,21 +24,22 @@ use Carbon\Carbon;
|
||||
*/
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\User::class, function (Faker\Generator $faker) {
|
||||
static $password;
|
||||
FireflyIII\User::class,
|
||||
function (Faker\Generator $faker) {
|
||||
static $password;
|
||||
|
||||
return [
|
||||
return [
|
||||
'email' => $faker->safeEmail,
|
||||
'password' => $password ?: $password = bcrypt('secret'),
|
||||
'remember_token' => str_random(10),
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\CurrencyExchangeRate::class, function (Faker\Generator $faker) {
|
||||
|
||||
return [
|
||||
FireflyIII\Models\CurrencyExchangeRate::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'user_id' => 1,
|
||||
'from_currency_id' => 1,
|
||||
'to_currency_id' => 2,
|
||||
@ -47,23 +47,24 @@ $factory->define(
|
||||
'rate' => '1.5',
|
||||
'user_rate' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\TransactionCurrency::class, function (Faker\Generator $faker) {
|
||||
|
||||
return [
|
||||
FireflyIII\Models\TransactionCurrency::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'name' => $faker->words(1, true),
|
||||
'code' => 'ABC',
|
||||
'symbol' => 'x',
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\ImportJob::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\ImportJob::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->numberBetween(1, 100),
|
||||
'user_id' => 1,
|
||||
'key' => $faker->words(1, true),
|
||||
@ -78,13 +79,14 @@ $factory->define(
|
||||
'errors' => [],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\TransactionJournal::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\TransactionJournal::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(1000, 10000),
|
||||
'user_id' => 1,
|
||||
'transaction_type_id' => 1,
|
||||
@ -101,12 +103,13 @@ $factory->define(
|
||||
'encrypted' => 0,
|
||||
'completed' => 1,
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\Bill::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\Bill::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->numberBetween(1, 10),
|
||||
'user_id' => 1,
|
||||
'name' => $faker->words(3, true),
|
||||
@ -120,24 +123,26 @@ $factory->define(
|
||||
'name_encrypted' => 0,
|
||||
'match_encrypted' => 0,
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\PiggyBankRepetition::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\PiggyBankRepetition::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(100, 10000),
|
||||
'piggy_bank_id' => $faker->numberBetween(1, 10),
|
||||
'startdate' => '2017-01-01',
|
||||
'targetdate' => '2020-01-01',
|
||||
'currentamount' => 10,
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\PiggyBank::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\PiggyBank::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(100, 10000),
|
||||
'account_id' => $faker->numberBetween(1, 10),
|
||||
'name' => $faker->words(3, true),
|
||||
@ -147,53 +152,58 @@ $factory->define(
|
||||
'active' => 1,
|
||||
'encrypted' => 0,
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\Tag::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\Tag::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(200, 10000),
|
||||
'user_id' => 1,
|
||||
'tagMode' => 'nothing',
|
||||
'tag' => $faker->words(1, true),
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\Category::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\Category::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->numberBetween(1, 10),
|
||||
'name' => $faker->words(3, true),
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\Budget::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\Budget::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->numberBetween(1, 10),
|
||||
'name' => $faker->words(3, true),
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\PiggyBankEvent::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\PiggyBankEvent::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->numberBetween(1, 10),
|
||||
'piggy_bank_id' => $faker->numberBetween(1, 10),
|
||||
'transaction_journal_id' => $faker->numberBetween(1, 10),
|
||||
'date' => $faker->date('Y-m-d'),
|
||||
'amount' => '100',
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\BudgetLimit::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\BudgetLimit::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->numberBetween(1, 10),
|
||||
'start_date' => '2017-01-01',
|
||||
'end_date' => '2017-01-31',
|
||||
@ -201,23 +211,25 @@ $factory->define(
|
||||
'budget_id' => $faker->numberBetween(1, 6),
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\Account::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\Account::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(1000, 10000),
|
||||
'name' => $faker->words(3, true),
|
||||
'account_type_id' => 1,
|
||||
'active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$factory->define(
|
||||
FireflyIII\Models\Transaction::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
FireflyIII\Models\Transaction::class,
|
||||
function (Faker\Generator $faker) {
|
||||
return [
|
||||
'transaction_amount' => strval($faker->randomFloat(2, -100, 100)),
|
||||
'destination_amount' => strval($faker->randomFloat(2, -100, 100)),
|
||||
'opposing_account_id' => $faker->numberBetween(1, 10),
|
||||
@ -244,5 +256,5 @@ $factory->define(
|
||||
'foreign_currency_code' => null,
|
||||
'foreign_currency_symbol' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -24,7 +24,6 @@ class CreateSupportTables extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
Schema::drop('account_types');
|
||||
Schema::drop('transaction_currencies');
|
||||
Schema::drop('transaction_types');
|
||||
@ -35,7 +34,6 @@ class CreateSupportTables extends Migration
|
||||
Schema::drop('roles');
|
||||
Schema::drop('sessions');
|
||||
Schema::drop('configuration');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,14 +62,15 @@ class CreateSupportTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('account_types')) {
|
||||
Schema::create(
|
||||
'account_types', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->string('type', 50);
|
||||
'account_types',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->string('type', 50);
|
||||
|
||||
// type must be unique.
|
||||
$table->unique(['type']);
|
||||
}
|
||||
// type must be unique.
|
||||
$table->unique(['type']);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -80,15 +79,15 @@ class CreateSupportTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('configuration')) {
|
||||
Schema::create(
|
||||
'configuration', function (Blueprint $table) {
|
||||
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->string('name', 50);
|
||||
$table->text('data');
|
||||
$table->unique(['name']);
|
||||
}
|
||||
'configuration',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->string('name', 50);
|
||||
$table->text('data');
|
||||
$table->unique(['name']);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -100,18 +99,18 @@ class CreateSupportTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('transaction_currencies')) {
|
||||
Schema::create(
|
||||
'transaction_currencies', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->string('code', 3);
|
||||
$table->string('name', 255);
|
||||
$table->string('symbol', 12);
|
||||
'transaction_currencies',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->string('code', 3);
|
||||
$table->string('name', 255);
|
||||
$table->string('symbol', 12);
|
||||
|
||||
// code must be unique.
|
||||
$table->unique(['code']);
|
||||
|
||||
}
|
||||
// code must be unique.
|
||||
$table->unique(['code']);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -123,20 +122,20 @@ class CreateSupportTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('jobs')) {
|
||||
Schema::create(
|
||||
'jobs', function (Blueprint $table) {
|
||||
'jobs',
|
||||
function (Blueprint $table) {
|
||||
|
||||
// straight from Laravel
|
||||
$table->bigIncrements('id');
|
||||
$table->string('queue');
|
||||
$table->longText('payload');
|
||||
$table->tinyInteger('attempts')->unsigned();
|
||||
$table->tinyInteger('reserved')->unsigned();
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
$table->index(['queue', 'reserved', 'reserved_at']);
|
||||
|
||||
}
|
||||
$table->bigIncrements('id');
|
||||
$table->string('queue');
|
||||
$table->longText('payload');
|
||||
$table->tinyInteger('attempts')->unsigned();
|
||||
$table->tinyInteger('reserved')->unsigned();
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
$table->index(['queue', 'reserved', 'reserved_at']);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -148,13 +147,13 @@ class CreateSupportTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('password_resets')) {
|
||||
Schema::create(
|
||||
'password_resets', function (Blueprint $table) {
|
||||
// straight from laravel
|
||||
$table->string('email')->index();
|
||||
$table->string('token')->index();
|
||||
$table->timestamp('created_at');
|
||||
|
||||
}
|
||||
'password_resets',
|
||||
function (Blueprint $table) {
|
||||
// straight from laravel
|
||||
$table->string('email')->index();
|
||||
$table->string('token')->index();
|
||||
$table->timestamp('created_at');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -166,15 +165,16 @@ class CreateSupportTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('permission_role')) {
|
||||
Schema::create(
|
||||
'permission_role', function (Blueprint $table) {
|
||||
$table->integer('permission_id')->unsigned();
|
||||
$table->integer('role_id')->unsigned();
|
||||
'permission_role',
|
||||
function (Blueprint $table) {
|
||||
$table->integer('permission_id')->unsigned();
|
||||
$table->integer('role_id')->unsigned();
|
||||
|
||||
$table->foreign('permission_id')->references('id')->on('permissions')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreign('permission_id')->references('id')->on('permissions')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade');
|
||||
|
||||
$table->primary(['permission_id', 'role_id']);
|
||||
}
|
||||
$table->primary(['permission_id', 'role_id']);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -186,13 +186,14 @@ class CreateSupportTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('permissions')) {
|
||||
Schema::create(
|
||||
'permissions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->string('name')->unique();
|
||||
$table->string('display_name')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
}
|
||||
'permissions',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->string('name')->unique();
|
||||
$table->string('display_name')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -204,13 +205,14 @@ class CreateSupportTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('roles')) {
|
||||
Schema::create(
|
||||
'roles', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->string('name')->unique();
|
||||
$table->string('display_name')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
}
|
||||
'roles',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->string('name')->unique();
|
||||
$table->string('display_name')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -220,17 +222,17 @@ class CreateSupportTables extends Migration
|
||||
*/
|
||||
private function createSessionsTable()
|
||||
{
|
||||
|
||||
if (!Schema::hasTable('sessions')) {
|
||||
Schema::create(
|
||||
'sessions', function (Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('user_id')->nullable();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->text('payload');
|
||||
$table->integer('last_activity');
|
||||
}
|
||||
'sessions',
|
||||
function (Blueprint $table) {
|
||||
$table->string('id')->unique();
|
||||
$table->integer('user_id')->nullable();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->text('payload');
|
||||
$table->integer('last_activity');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -242,16 +244,16 @@ class CreateSupportTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('transaction_types')) {
|
||||
Schema::create(
|
||||
'transaction_types', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->string('type', 50);
|
||||
'transaction_types',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->string('type', 50);
|
||||
|
||||
// type must be unique.
|
||||
$table->unique(['type']);
|
||||
|
||||
}
|
||||
// type must be unique.
|
||||
$table->unique(['type']);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -35,16 +35,17 @@ class CreateUsersTable extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('users')) {
|
||||
Schema::create(
|
||||
'users', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->string('email', 255);
|
||||
$table->string('password', 60);
|
||||
$table->string('remember_token', 100)->nullable();
|
||||
$table->string('reset', 32)->nullable();
|
||||
$table->tinyInteger('blocked', false, true)->default('0');
|
||||
$table->string('blocked_code', 25)->nullable();
|
||||
}
|
||||
'users',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->string('email', 255);
|
||||
$table->string('password', 60);
|
||||
$table->string('remember_token', 100)->nullable();
|
||||
$table->string('reset', 32)->nullable();
|
||||
$table->tinyInteger('blocked', false, true)->default('0');
|
||||
$table->string('blocked_code', 25)->nullable();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -82,33 +82,35 @@ class CreateMainTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('accounts')) {
|
||||
Schema::create(
|
||||
'accounts', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('account_type_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->decimal('virtual_balance', 22, 12)->nullable();
|
||||
$table->string('iban', 255)->nullable();
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('encrypted')->default(0);
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade');
|
||||
}
|
||||
'accounts',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('account_type_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->decimal('virtual_balance', 22, 12)->nullable();
|
||||
$table->string('iban', 255)->nullable();
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('encrypted')->default(0);
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('account_meta')) {
|
||||
Schema::create(
|
||||
'account_meta', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('account_id', false, true);
|
||||
$table->string('name');
|
||||
$table->text('data');
|
||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||
}
|
||||
'account_meta',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('account_id', false, true);
|
||||
$table->string('name');
|
||||
$table->text('data');
|
||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -118,30 +120,28 @@ class CreateMainTables extends Migration
|
||||
*/
|
||||
private function createAttachmentsTable()
|
||||
{
|
||||
|
||||
if (!Schema::hasTable('attachments')) {
|
||||
Schema::create(
|
||||
'attachments', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('attachable_id', false, true);
|
||||
$table->string('attachable_type', 255);
|
||||
$table->string('md5', 32);
|
||||
$table->string('filename', 1024);
|
||||
$table->string('title', 1024)->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->text('notes')->nullable();
|
||||
$table->string('mime', 1024);
|
||||
$table->integer('size', false, true);
|
||||
$table->boolean('uploaded')->default(1);
|
||||
'attachments',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('attachable_id', false, true);
|
||||
$table->string('attachable_type', 255);
|
||||
$table->string('md5', 32);
|
||||
$table->string('filename', 1024);
|
||||
$table->string('title', 1024)->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->text('notes')->nullable();
|
||||
$table->string('mime', 1024);
|
||||
$table->integer('size', false, true);
|
||||
$table->boolean('uploaded')->default(1);
|
||||
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
|
||||
|
||||
}
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -153,26 +153,27 @@ class CreateMainTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('bills')) {
|
||||
Schema::create(
|
||||
'bills', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->string('match', 1024);
|
||||
$table->decimal('amount_min', 22, 12);
|
||||
$table->decimal('amount_max', 22, 12);
|
||||
$table->date('date');
|
||||
$table->string('repeat_freq', 30);
|
||||
$table->smallInteger('skip', false, true)->default(0);
|
||||
$table->boolean('automatch')->default(1);
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('name_encrypted')->default(0);
|
||||
$table->boolean('match_encrypted')->default(0);
|
||||
'bills',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->string('match', 1024);
|
||||
$table->decimal('amount_min', 22, 12);
|
||||
$table->decimal('amount_max', 22, 12);
|
||||
$table->date('date');
|
||||
$table->string('repeat_freq', 30);
|
||||
$table->smallInteger('skip', false, true)->default(0);
|
||||
$table->boolean('automatch')->default(1);
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('name_encrypted')->default(0);
|
||||
$table->boolean('match_encrypted')->default(0);
|
||||
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -184,46 +185,46 @@ class CreateMainTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('budgets')) {
|
||||
Schema::create(
|
||||
'budgets', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('encrypted')->default(0);
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
|
||||
|
||||
}
|
||||
'budgets',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('encrypted')->default(0);
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
if (!Schema::hasTable('budget_limits')) {
|
||||
Schema::create(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('budget_id', false, true);
|
||||
$table->date('startdate');
|
||||
$table->decimal('amount', 22, 12);
|
||||
$table->string('repeat_freq', 30);
|
||||
$table->boolean('repeats')->default(0);
|
||||
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
|
||||
|
||||
}
|
||||
'budget_limits',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('budget_id', false, true);
|
||||
$table->date('startdate');
|
||||
$table->decimal('amount', 22, 12);
|
||||
$table->string('repeat_freq', 30);
|
||||
$table->boolean('repeats')->default(0);
|
||||
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
if (!Schema::hasTable('limit_repetitions')) {
|
||||
Schema::create(
|
||||
'limit_repetitions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('budget_limit_id', false, true);
|
||||
$table->date('startdate');
|
||||
$table->date('enddate');
|
||||
$table->decimal('amount', 22, 12);
|
||||
$table->foreign('budget_limit_id')->references('id')->on('budget_limits')->onDelete('cascade');
|
||||
}
|
||||
'limit_repetitions',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('budget_limit_id', false, true);
|
||||
$table->date('startdate');
|
||||
$table->date('enddate');
|
||||
$table->decimal('amount', 22, 12);
|
||||
$table->foreign('budget_limit_id')->references('id')->on('budget_limits')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -235,18 +236,18 @@ class CreateMainTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('categories')) {
|
||||
Schema::create(
|
||||
'categories', function (Blueprint $table) {
|
||||
'categories',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->boolean('encrypted')->default(0);
|
||||
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->boolean('encrypted')->default(0);
|
||||
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -258,32 +259,33 @@ class CreateMainTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('export_jobs')) {
|
||||
Schema::create(
|
||||
'export_jobs', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('key', 12);
|
||||
$table->string('status', 255);
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
'export_jobs',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('key', 12);
|
||||
$table->string('status', 255);
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('import_jobs')) {
|
||||
Schema::create(
|
||||
'import_jobs', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->string('key', 12)->unique();
|
||||
$table->string('file_type', 12);
|
||||
$table->string('status', 45);
|
||||
$table->text('configuration')->nullable();
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
'import_jobs',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->string('key', 12)->unique();
|
||||
$table->string('file_type', 12);
|
||||
$table->string('status', 45);
|
||||
$table->text('configuration')->nullable();
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -293,34 +295,36 @@ class CreateMainTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('piggy_banks')) {
|
||||
Schema::create(
|
||||
'piggy_banks', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('account_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->decimal('targetamount', 22, 12);
|
||||
$table->date('startdate')->nullable();
|
||||
$table->date('targetdate')->nullable();
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->boolean('active')->default(0);
|
||||
$table->boolean('encrypted')->default(1);
|
||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||
}
|
||||
'piggy_banks',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('account_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->decimal('targetamount', 22, 12);
|
||||
$table->date('startdate')->nullable();
|
||||
$table->date('targetdate')->nullable();
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->boolean('active')->default(0);
|
||||
$table->boolean('encrypted')->default(1);
|
||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('piggy_bank_repetitions')) {
|
||||
Schema::create(
|
||||
'piggy_bank_repetitions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('piggy_bank_id', false, true);
|
||||
$table->date('startdate')->nullable();
|
||||
$table->date('targetdate')->nullable();
|
||||
$table->decimal('currentamount', 22, 12);
|
||||
$table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade');
|
||||
}
|
||||
'piggy_bank_repetitions',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('piggy_bank_id', false, true);
|
||||
$table->date('startdate')->nullable();
|
||||
$table->date('targetdate')->nullable();
|
||||
$table->decimal('currentamount', 22, 12);
|
||||
$table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -332,15 +336,16 @@ class CreateMainTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('preferences')) {
|
||||
Schema::create(
|
||||
'preferences', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->text('data');
|
||||
'preferences',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('name', 1024);
|
||||
$table->text('data');
|
||||
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -350,22 +355,20 @@ class CreateMainTables extends Migration
|
||||
*/
|
||||
private function createRoleTable()
|
||||
{
|
||||
|
||||
if (!Schema::hasTable('role_user')) {
|
||||
Schema::create(
|
||||
'role_user', function (Blueprint $table) {
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('role_id', false, true);
|
||||
'role_user',
|
||||
function (Blueprint $table) {
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('role_id', false, true);
|
||||
|
||||
$table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade');
|
||||
|
||||
$table->primary(['user_id', 'role_id']);
|
||||
|
||||
}
|
||||
$table->primary(['user_id', 'role_id']);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -376,81 +379,85 @@ class CreateMainTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('rule_groups')) {
|
||||
Schema::create(
|
||||
'rule_groups', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('title', 255);
|
||||
$table->text('description')->nullable();
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->boolean('active')->default(1);
|
||||
'rule_groups',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->string('title', 255);
|
||||
$table->text('description')->nullable();
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->boolean('active')->default(1);
|
||||
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
if (!Schema::hasTable('rules')) {
|
||||
Schema::create(
|
||||
'rules', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('rule_group_id', false, true);
|
||||
$table->string('title', 255);
|
||||
$table->text('description')->nullable();
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('stop_processing')->default(0);
|
||||
'rules',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('rule_group_id', false, true);
|
||||
$table->string('title', 255);
|
||||
$table->text('description')->nullable();
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('stop_processing')->default(0);
|
||||
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
|
||||
// link rule group id to rule group table
|
||||
$table->foreign('rule_group_id')->references('id')->on('rule_groups')->onDelete('cascade');
|
||||
}
|
||||
// link rule group id to rule group table
|
||||
$table->foreign('rule_group_id')->references('id')->on('rule_groups')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
if (!Schema::hasTable('rule_actions')) {
|
||||
Schema::create(
|
||||
'rule_actions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('rule_id', false, true);
|
||||
'rule_actions',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('rule_id', false, true);
|
||||
|
||||
$table->string('action_type', 50);
|
||||
$table->string('action_value', 255);
|
||||
$table->string('action_type', 50);
|
||||
$table->string('action_value', 255);
|
||||
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('stop_processing')->default(0);
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('stop_processing')->default(0);
|
||||
|
||||
|
||||
// link rule id to rules table
|
||||
$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');
|
||||
}
|
||||
// link rule id to rules table
|
||||
$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
if (!Schema::hasTable('rule_triggers')) {
|
||||
Schema::create(
|
||||
'rule_triggers', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('rule_id', false, true);
|
||||
'rule_triggers',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('rule_id', false, true);
|
||||
|
||||
$table->string('trigger_type', 50);
|
||||
$table->string('trigger_value', 255);
|
||||
$table->string('trigger_type', 50);
|
||||
$table->string('trigger_value', 255);
|
||||
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('stop_processing')->default(0);
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->boolean('active')->default(1);
|
||||
$table->boolean('stop_processing')->default(0);
|
||||
|
||||
|
||||
// link rule id to rules table
|
||||
$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');
|
||||
}
|
||||
// link rule id to rules table
|
||||
$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -462,24 +469,24 @@ class CreateMainTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('tags')) {
|
||||
Schema::create(
|
||||
'tags', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
'tags',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
|
||||
$table->string('tag', 1024);
|
||||
$table->string('tagMode', 1024);
|
||||
$table->date('date')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->decimal('latitude', 24, 12)->nullable();
|
||||
$table->decimal('longitude', 24, 12)->nullable();
|
||||
$table->smallInteger('zoomLevel', false, true)->nullable();
|
||||
$table->string('tag', 1024);
|
||||
$table->string('tagMode', 1024);
|
||||
$table->date('date')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->decimal('latitude', 24, 12)->nullable();
|
||||
$table->decimal('longitude', 24, 12)->nullable();
|
||||
$table->smallInteger('zoomLevel', false, true)->nullable();
|
||||
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
|
||||
}
|
||||
// link user id to users table
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -493,141 +500,147 @@ class CreateMainTables extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('transaction_journals')) {
|
||||
Schema::create(
|
||||
'transaction_journals', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('transaction_type_id', false, true);
|
||||
$table->integer('bill_id', false, true)->nullable();
|
||||
$table->integer('transaction_currency_id', false, true);
|
||||
$table->string('description', 1024);
|
||||
$table->date('date');
|
||||
$table->date('interest_date')->nullable();
|
||||
$table->date('book_date')->nullable();
|
||||
$table->date('process_date')->nullable();
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->integer('tag_count', false, true);
|
||||
$table->boolean('encrypted')->default(1);
|
||||
$table->boolean('completed')->default(1);
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
|
||||
$table->foreign('bill_id')->references('id')->on('bills')->onDelete('set null');
|
||||
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
|
||||
}
|
||||
'transaction_journals',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('transaction_type_id', false, true);
|
||||
$table->integer('bill_id', false, true)->nullable();
|
||||
$table->integer('transaction_currency_id', false, true);
|
||||
$table->string('description', 1024);
|
||||
$table->date('date');
|
||||
$table->date('interest_date')->nullable();
|
||||
$table->date('book_date')->nullable();
|
||||
$table->date('process_date')->nullable();
|
||||
$table->integer('order', false, true)->default(0);
|
||||
$table->integer('tag_count', false, true);
|
||||
$table->boolean('encrypted')->default(1);
|
||||
$table->boolean('completed')->default(1);
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
|
||||
$table->foreign('bill_id')->references('id')->on('bills')->onDelete('set null');
|
||||
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('journal_meta')) {
|
||||
Schema::create(
|
||||
'journal_meta', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->string('name', 255);
|
||||
$table->text('data');
|
||||
$table->string('hash', 64);
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
}
|
||||
'journal_meta',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->string('name', 255);
|
||||
$table->text('data');
|
||||
$table->string('hash', 64);
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('tag_transaction_journal')) {
|
||||
Schema::create(
|
||||
'tag_transaction_journal', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('tag_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
|
||||
|
||||
}
|
||||
'tag_transaction_journal',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('tag_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('budget_transaction_journal')) {
|
||||
Schema::create(
|
||||
'budget_transaction_journal', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('budget_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
}
|
||||
'budget_transaction_journal',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('budget_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('category_transaction_journal')) {
|
||||
Schema::create(
|
||||
'category_transaction_journal', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('category_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
}
|
||||
'category_transaction_journal',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('category_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (!Schema::hasTable('piggy_bank_events')) {
|
||||
Schema::create(
|
||||
'piggy_bank_events', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('piggy_bank_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true)->nullable();
|
||||
$table->date('date');
|
||||
$table->decimal('amount', 22, 12);
|
||||
'piggy_bank_events',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('piggy_bank_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true)->nullable();
|
||||
$table->date('date');
|
||||
$table->decimal('amount', 22, 12);
|
||||
|
||||
$table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null');
|
||||
}
|
||||
$table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('transactions')) {
|
||||
Schema::create(
|
||||
'transactions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('account_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->string('description', 1024)->nullable();
|
||||
$table->decimal('amount', 22, 12);
|
||||
'transactions',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('account_id', false, true);
|
||||
$table->integer('transaction_journal_id', false, true);
|
||||
$table->string('description', 1024)->nullable();
|
||||
$table->decimal('amount', 22, 12);
|
||||
|
||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
|
||||
}
|
||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('budget_transaction')) {
|
||||
Schema::create(
|
||||
'budget_transaction', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('budget_id', false, true);
|
||||
$table->integer('transaction_id', false, true);
|
||||
'budget_transaction',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('budget_id', false, true);
|
||||
$table->integer('transaction_id', false, true);
|
||||
|
||||
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
|
||||
$table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
|
||||
}
|
||||
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
|
||||
$table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('category_transaction')) {
|
||||
Schema::create(
|
||||
'category_transaction', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('category_id', false, true);
|
||||
$table->integer('transaction_id', false, true);
|
||||
'category_transaction',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('category_id', false, true);
|
||||
$table->integer('transaction_id', false, true);
|
||||
|
||||
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
|
||||
$table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
|
||||
}
|
||||
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
|
||||
$table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -34,9 +34,10 @@ class ChangesFor3101 extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table(
|
||||
'import_jobs', function (Blueprint $table) {
|
||||
$table->text('extended_status')->nullable();
|
||||
}
|
||||
'import_jobs',
|
||||
function (Blueprint $table) {
|
||||
$table->text('extended_status')->nullable();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ class FixNullables extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -35,15 +34,17 @@ class FixNullables extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table(
|
||||
'rule_groups', function (Blueprint $table) {
|
||||
$table->text('description')->nullable()->change();
|
||||
}
|
||||
'rule_groups',
|
||||
function (Blueprint $table) {
|
||||
$table->text('description')->nullable()->change();
|
||||
}
|
||||
);
|
||||
|
||||
Schema::table(
|
||||
'rules', function (Blueprint $table) {
|
||||
$table->text('description')->nullable()->change();
|
||||
}
|
||||
'rules',
|
||||
function (Blueprint $table) {
|
||||
$table->text('description')->nullable()->change();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -35,9 +35,10 @@ class ExpandTransactionsTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table(
|
||||
'transactions', function (Blueprint $table) {
|
||||
$table->smallInteger('identifier', false, true)->default(0);
|
||||
}
|
||||
'transactions',
|
||||
function (Blueprint $table) {
|
||||
$table->smallInteger('identifier', false, true)->default(0);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
|
||||
/**
|
||||
* Class ChangesForV410
|
||||
*/
|
||||
@ -36,15 +35,16 @@ class ChangesForV410 extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create(
|
||||
'notes', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('noteable_id', false, true);
|
||||
$table->string('noteable_type');
|
||||
$table->string('title')->nullable();
|
||||
$table->text('text')->nullable();
|
||||
}
|
||||
'notes',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('noteable_id', false, true);
|
||||
$table->string('noteable_type');
|
||||
$table->string('title')->nullable();
|
||||
$table->text('text')->nullable();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -35,9 +35,10 @@ class ChangesForV420 extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table(
|
||||
'journal_meta', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
}
|
||||
'journal_meta',
|
||||
function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -36,20 +36,21 @@ class ChangesForV430 extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create(
|
||||
'available_budgets', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('transaction_currency_id', false, true);
|
||||
$table->decimal('amount', 22, 12);
|
||||
$table->date('start_date');
|
||||
$table->date('end_date');
|
||||
'available_budgets',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('transaction_currency_id', false, true);
|
||||
$table->decimal('amount', 22, 12);
|
||||
$table->date('start_date');
|
||||
$table->date('end_date');
|
||||
|
||||
|
||||
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -28,24 +28,26 @@ class ChangesForV431 extends Migration
|
||||
{
|
||||
// reinstate "repeats" and "repeat_freq".
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->string('repeat_freq', 30)->nullable();
|
||||
}
|
||||
'budget_limits',
|
||||
function (Blueprint $table) {
|
||||
$table->string('repeat_freq', 30)->nullable();
|
||||
}
|
||||
);
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->boolean('repeats')->default(0);
|
||||
}
|
||||
'budget_limits',
|
||||
function (Blueprint $table) {
|
||||
$table->boolean('repeats')->default(0);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// remove date field "end_date"
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->dropColumn('end_date');
|
||||
}
|
||||
'budget_limits',
|
||||
function (Blueprint $table) {
|
||||
$table->dropColumn('end_date');
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -57,38 +59,40 @@ class ChangesForV431 extends Migration
|
||||
{
|
||||
// add decimal places to "transaction currencies".
|
||||
Schema::table(
|
||||
'transaction_currencies', function (Blueprint $table) {
|
||||
$table->smallInteger('decimal_places', false, true)->default(2);
|
||||
}
|
||||
'transaction_currencies',
|
||||
function (Blueprint $table) {
|
||||
$table->smallInteger('decimal_places', false, true)->default(2);
|
||||
}
|
||||
);
|
||||
|
||||
// change field "startdate" to "start_date"
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->renameColumn('startdate', 'start_date');
|
||||
}
|
||||
'budget_limits',
|
||||
function (Blueprint $table) {
|
||||
$table->renameColumn('startdate', 'start_date');
|
||||
}
|
||||
);
|
||||
|
||||
// add date field "end_date" after "start_date"
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->date('end_date')->nullable()->after('start_date');
|
||||
}
|
||||
'budget_limits',
|
||||
function (Blueprint $table) {
|
||||
$table->date('end_date')->nullable()->after('start_date');
|
||||
}
|
||||
);
|
||||
|
||||
// drop "repeats" and "repeat_freq".
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->dropColumn('repeats');
|
||||
|
||||
}
|
||||
'budget_limits',
|
||||
function (Blueprint $table) {
|
||||
$table->dropColumn('repeats');
|
||||
}
|
||||
);
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->dropColumn('repeat_freq');
|
||||
}
|
||||
'budget_limits',
|
||||
function (Blueprint $table) {
|
||||
$table->dropColumn('repeat_freq');
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -42,30 +42,31 @@ class ChangesForV440 extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('currency_exchange_rates')) {
|
||||
Schema::create(
|
||||
'currency_exchange_rates', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('from_currency_id', false, true);
|
||||
$table->integer('to_currency_id', false, true);
|
||||
$table->date('date');
|
||||
$table->decimal('rate', 22, 12);
|
||||
$table->decimal('user_rate', 22, 12)->nullable();
|
||||
'currency_exchange_rates',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->integer('user_id', false, true);
|
||||
$table->integer('from_currency_id', false, true);
|
||||
$table->integer('to_currency_id', false, true);
|
||||
$table->date('date');
|
||||
$table->decimal('rate', 22, 12);
|
||||
$table->decimal('user_rate', 22, 12)->nullable();
|
||||
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->foreign('from_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
|
||||
$table->foreign('to_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
|
||||
}
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->foreign('from_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
|
||||
$table->foreign('to_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
//
|
||||
Schema::table(
|
||||
'transactions', function (Blueprint $table) {
|
||||
$table->integer('transaction_currency_id', false, true)->after('description')->nullable();
|
||||
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
|
||||
}
|
||||
'transactions',
|
||||
function (Blueprint $table) {
|
||||
$table->integer('transaction_currency_id', false, true)->after('description')->nullable();
|
||||
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -39,17 +39,19 @@ class ChangesForV450 extends Migration
|
||||
{
|
||||
// add "foreign_amount" to transactions
|
||||
Schema::table(
|
||||
'transactions', function (Blueprint $table) {
|
||||
$table->decimal('foreign_amount', 22, 12)->nullable()->after('amount');
|
||||
}
|
||||
'transactions',
|
||||
function (Blueprint $table) {
|
||||
$table->decimal('foreign_amount', 22, 12)->nullable()->after('amount');
|
||||
}
|
||||
);
|
||||
|
||||
// add foreign transaction currency id to transactions (is nullable):
|
||||
Schema::table(
|
||||
'transactions', function (Blueprint $table) {
|
||||
$table->integer('foreign_currency_id', false, true)->default(null)->after('foreign_amount')->nullable();
|
||||
$table->foreign('foreign_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
|
||||
}
|
||||
'transactions',
|
||||
function (Blueprint $table) {
|
||||
$table->integer('foreign_currency_id', false, true)->default(null)->after('foreign_amount')->nullable();
|
||||
$table->foreign('foreign_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ class ChangesForV470 extends Migration
|
||||
{
|
||||
Schema::dropIfExists('journal_links');
|
||||
Schema::dropIfExists('link_types');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -33,38 +32,38 @@ class ChangesForV470 extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('link_types')) {
|
||||
Schema::create(
|
||||
'link_types', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->string('name');
|
||||
$table->string('outward');
|
||||
$table->string('inward');
|
||||
$table->boolean('editable');
|
||||
'link_types',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->string('name');
|
||||
$table->string('outward');
|
||||
$table->string('inward');
|
||||
$table->boolean('editable');
|
||||
|
||||
$table->unique(['name', 'outward','inward']);
|
||||
}
|
||||
$table->unique(['name', 'outward','inward']);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('journal_links')) {
|
||||
Schema::create(
|
||||
'journal_links', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('link_type_id', false, true);
|
||||
$table->integer('source_id', false, true);
|
||||
$table->integer('destination_id', false, true);
|
||||
$table->text('comment')->nullable();
|
||||
'journal_links',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('link_type_id', false, true);
|
||||
$table->integer('source_id', false, true);
|
||||
$table->integer('destination_id', false, true);
|
||||
$table->text('comment')->nullable();
|
||||
|
||||
$table->foreign('link_type_id')->references('id')->on('link_types')->onDelete('cascade');
|
||||
$table->foreign('source_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
$table->foreign('destination_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
$table->foreign('link_type_id')->references('id')->on('link_types')->onDelete('cascade');
|
||||
$table->foreign('source_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
$table->foreign('destination_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||
|
||||
$table->unique(['link_type_id','source_id','destination_id']);
|
||||
|
||||
|
||||
}
|
||||
$table->unique(['link_type_id','source_id','destination_id']);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -27,9 +27,10 @@ class ChangesForV470a extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table(
|
||||
'transactions', function (Blueprint $table) {
|
||||
$table->boolean('reconciled')->after('deleted_at')->default(0);
|
||||
}
|
||||
'transactions',
|
||||
function (Blueprint $table) {
|
||||
$table->boolean('reconciled')->after('deleted_at')->default(0);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,4 @@ class AccountTypeSeeder extends Seeder
|
||||
AccountType::create(['type' => 'Import account']);
|
||||
AccountType::create(['type' => 'Loan']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,5 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(TransactionTypeSeeder::class);
|
||||
$this->call(PermissionSeeder::class);
|
||||
$this->call(LinkTypeSeeder::class);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,5 @@ class LinkTypeSeeder extends Seeder
|
||||
$link->outward = '(partially) reimburses';
|
||||
$link->editable = false;
|
||||
$link->save();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,7 +33,5 @@ class PermissionSeeder extends Seeder
|
||||
$demo->display_name = 'Demo User';
|
||||
$demo->description = 'User is a demo user';
|
||||
$demo->save();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -30,5 +30,4 @@ class TransactionCurrencySeeder extends Seeder
|
||||
TransactionCurrency::create(['code' => 'XBT', 'name' => 'Bitcoin', 'symbol' => 'B', 'decimal_places' => 8]);
|
||||
TransactionCurrency::create(['code' => 'JPY', 'name' => 'Japanese yen', 'symbol' => '¥', 'decimal_places' => 2]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -26,5 +26,4 @@ class TransactionTypeSeeder extends Seeder
|
||||
TransactionType::create(['type' => TransactionType::TRANSFER]);
|
||||
TransactionType::create(['type' => TransactionType::OPENING_BALANCE]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user