Initial refactoring work

This commit is contained in:
Deon George
2018-05-20 22:53:14 +10:00
parent d6cb505e1c
commit feda44db8a
121 changed files with 6601 additions and 602 deletions

View File

@@ -1,35 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}

View File

@@ -1,42 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableSites extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sites', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('url');
$table->string('devurl')->nullable();
$table->string('name');
$table->json('address')->nullable();
$table->string('description')->nullable();
$table->string('email');
$table->string('phone')->nullable();
$table->string('fax')->nullable();
$table->string('logo')->nullable();
$table->string('favicon')->nullable();
$table->string('theme');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sites');
}
}

View File

@@ -1,34 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCurrencies extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('currencies', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('symbol',2)->nullable();
$table->string('threecode',3);
$table->boolean('active');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('currencies');
}
}

View File

@@ -1,37 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCountries extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('countries', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('twocode',2)->nullable();
$table->string('threecode',3);
$table->integer('currency_id')->unsigned()->nullable();
$table->boolean('active');
$table->foreign('currency_id')->references('id')->on('currencies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('countries');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\Models\Currency;
class CurrencyAddRounding extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ab_currency', function (Blueprint $table) {
$table->smallInteger('rounding');
});
Currency::query()->update(['rounding'=>2]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ab_currency', function (Blueprint $table) {
$table->dropColumn('rounding');
});
}
}

View File

@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePasswordResetsTable extends Migration
class AccountAddRememberToken extends Migration
{
/**
* Run the migrations.
@@ -13,10 +13,8 @@ class CreatePasswordResetsTable extends Migration
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
Schema::table('ab_account', function (Blueprint $table) {
$table->rememberToken();
});
}
@@ -27,6 +25,8 @@ class CreatePasswordResetsTable extends Migration
*/
public function down()
{
Schema::dropIfExists('password_resets');
Schema::table('ab_account', function (Blueprint $table) {
$table->dropRememberToken();
});
}
}