Skip to content

Commit

Permalink
Merge pull request #5 from ekmungai/users-conflict
Browse files Browse the repository at this point in the history
Users conflict
  • Loading branch information
ekmungai authored May 23, 2020
2 parents 54b9129 + 7c19e99 commit 321209f
Show file tree
Hide file tree
Showing 33 changed files with 162 additions and 145 deletions.
44 changes: 26 additions & 18 deletions database/migrations/2014_10_12_000000_create_users_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,38 @@ class CreateUsersTable extends Migration
*/
public function up()
{
Schema::create(
'users',
function (Blueprint $table) {
$table->bigIncrements('id');

if (Schema::hasTable('users')) {
Schema::table('users', function (Blueprint $table) {
//entity
$table->unsignedBigInteger('entity_id')->nullable();

// attributes
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
});
}else{
Schema::create(
'users',
function (Blueprint $table) {
$table->bigIncrements('id');

//entity
$table->unsignedBigInteger('entity_id')->nullable();

// attributes
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();

// *permanent* deletion
$table->dateTime('destroyed_at')->nullable();
// *permanent* deletion
$table->dateTime('destroyed_at')->nullable();

//soft deletion
$table->softDeletes();
//soft deletion
$table->softDeletes();

$table->timestamps();
}
);
$table->timestamps();
}
);
}
}

/**
Expand Down

This file was deleted.

44 changes: 0 additions & 44 deletions database/migrations/2019_08_19_000000_create_failed_jobs_table.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CreateEntitiesTable extends Migration
public function up()
{
Schema::create(
'entities',
'ifrs_entities',
function (Blueprint $table) {
$table->bigIncrements('id');

Expand Down Expand Up @@ -50,6 +50,6 @@ function (Blueprint $table) {
*/
public function down()
{
Schema::dropIfExists('entities');
Schema::dropIfExists('ifrs_entities');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CreateCurrenciesTable extends Migration
public function up()
{
Schema::create(
'currencies',
'ifrs_currencies',
function (Blueprint $table) {
$table->bigIncrements('id');

Expand All @@ -46,6 +46,6 @@ function (Blueprint $table) {
*/
public function down()
{
Schema::dropIfExists('currencies');
Schema::dropIfExists('ifrs_currencies');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CreateExchangeRatesTable extends Migration
public function up()
{
Schema::create(
'exchange_rates',
'ifrs_exchange_rates',
function (Blueprint $table) {
$table->bigIncrements('id');

Expand Down Expand Up @@ -55,6 +55,6 @@ function (Blueprint $table) {
*/
public function down()
{
Schema::dropIfExists('exchange_rates');
Schema::dropIfExists('ifrs_exchange_rates');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CreateReportingPeriodsTable extends Migration
public function up()
{
Schema::create(
'reporting_periods',
'ifrs_reporting_periods',
function (Blueprint $table) {
$table->bigIncrements('id');

Expand Down Expand Up @@ -58,6 +58,6 @@ function (Blueprint $table) {
*/
public function down()
{
Schema::dropIfExists('reporting_periods');
Schema::dropIfExists('ifrs_reporting_periods');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CreateRecycledObjectsTable extends Migration
public function up()
{
Schema::create(
'recycled_objects',
'ifrs_recycled_objects',
function (Blueprint $table) {
$table->bigIncrements('id');

Expand Down Expand Up @@ -54,6 +54,6 @@ function (Blueprint $table) {
*/
public function down()
{
Schema::dropIfExists('recycled_objects');
Schema::dropIfExists('ifrs_recycled_objects');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CreateCategoriesTable extends Migration
public function up()
{
Schema::create(
'categories',
'ifrs_categories',
function (Blueprint $table) {
$table->bigIncrements('id');

Expand Down Expand Up @@ -55,6 +55,6 @@ function (Blueprint $table) {
*/
public function down()
{
Schema::dropIfExists('categories');
Schema::dropIfExists('ifrs_categories');
}
}
4 changes: 2 additions & 2 deletions database/migrations/2020_01_16_215416_create_vats_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CreateVatsTable extends Migration
public function up()
{
Schema::create(
'vats',
'ifrs_vats',
function (Blueprint $table) {
$table->bigIncrements('id');

Expand Down Expand Up @@ -53,6 +53,6 @@ function (Blueprint $table) {
*/
public function down()
{
Schema::dropIfExists('vats');
Schema::dropIfExists('ifrs_vats');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CreateAccountsTable extends Migration
public function up()
{
Schema::create(
'accounts',
'ifrs_accounts',
function (Blueprint $table) {
$table->bigIncrements('id');

Expand Down Expand Up @@ -61,6 +61,6 @@ function (Blueprint $table) {
*/
public function down()
{
Schema::dropIfExists('accounts');
Schema::dropIfExists('ifrs_accounts');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CreateBalancesTable extends Migration
*/
public function up()
{
Schema::create('balances', function (Blueprint $table) {
Schema::create('ifrs_balances', function (Blueprint $table) {
$table->bigIncrements('id');

// relationships
Expand Down Expand Up @@ -66,6 +66,6 @@ public function up()
*/
public function down()
{
Schema::dropIfExists('balances');
Schema::dropIfExists('ifrs_balances');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CreateTransactionsTable extends Migration
*/
public function up()
{
Schema::create('transactions', function (Blueprint $table) {
Schema::create('ifrs_transactions', function (Blueprint $table) {
$table->bigIncrements('id');

// relationships
Expand Down Expand Up @@ -71,6 +71,6 @@ public function up()
*/
public function down()
{
Schema::dropIfExists('transactions');
Schema::dropIfExists('ifrs_transactions');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CreateAssignmentsTable extends Migration
*/
public function up()
{
Schema::create('assignments', function (Blueprint $table) {
Schema::create('ifrs_assignments', function (Blueprint $table) {
$table->bigIncrements('id');

// relationships
Expand Down Expand Up @@ -51,6 +51,6 @@ public function up()
*/
public function down()
{
Schema::dropIfExists('assignments');
Schema::dropIfExists('ifrs_assignments');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CreateLineItemsTable extends Migration
*/
public function up()
{
Schema::create('line_items', function (Blueprint $table) {
Schema::create('ifrs_line_items', function (Blueprint $table) {
$table->bigIncrements('id');

// relationships
Expand Down Expand Up @@ -59,6 +59,6 @@ public function up()
*/
public function down()
{
Schema::dropIfExists('line_items');
Schema::dropIfExists('ifrs_line_items');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CreateLedgersTable extends Migration
*/
public function up()
{
Schema::create('ledgers', function (Blueprint $table) {
Schema::create('ifrs_ledgers', function (Blueprint $table) {
$table->bigIncrements('id');

// relationships
Expand Down Expand Up @@ -62,6 +62,6 @@ public function up()
*/
public function down()
{
Schema::dropIfExists('ledgers');
Schema::dropIfExists('ifrs_ledgers');
}
}
7 changes: 7 additions & 0 deletions src/Models/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ class Account extends Model implements Recyclable, Segragatable
use SoftDeletes;
use Recycling;

/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'ifrs_accounts';

/**
* Account Type.
*
Expand Down
7 changes: 7 additions & 0 deletions src/Models/Assignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ class Assignment extends Model implements Segragatable
use Segragating;
use SoftDeletes;

/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'ifrs_assignments';

/**
* The attributes that are mass assignable.
*
Expand Down
Loading

0 comments on commit 321209f

Please sign in to comment.