Fixes for CI

This commit is contained in:
Deon George 2018-07-10 13:42:17 +10:00
parent 14b568b735
commit 96673a9e53
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254
5 changed files with 58 additions and 28 deletions

View File

@ -63,7 +63,6 @@ before_script:
# DB_DATABASE=project_name # DB_DATABASE=project_name
# DB_USERNAME=root # DB_USERNAME=root
# DB_PASSWORD=secret # DB_PASSWORD=secret
- cp .env.testing .env
# Run npm build # Run npm build
# comment this out if you don't have a frontend build # comment this out if you don't have a frontend build
@ -72,8 +71,8 @@ before_script:
- npm run dev - npm run dev
# Generate an application key. Re-cache. # Generate an application key. Re-cache.
- php artisan key:generate - php artisan key:generate --env=testing
- php artisan config:cache - php artisan config:cache --env=testing
# Run database migrations. # Run database migrations.
- php artisan migrate - php artisan migrate

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UsersAddLanguage extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->integer('language_id')->nullable();
$table->foreign('language_id')->references('id')->on('ab_language');
$table->integer('currency_id')->nullable();
$table->foreign('currency_id')->references('id')->on('ab_currency');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropForeign(['language_id']);
$table->dropColumn('language_id');
$table->dropForeign(['currency_id']);
$table->dropColumn('currency_id');
});
}
}

View File

@ -17,7 +17,6 @@ class DatabaseSeeder extends Seeder
LanguageTableSeeder::class, LanguageTableSeeder::class,
SiteTableSeeder::class, SiteTableSeeder::class,
UserTableSeeder::class, UserTableSeeder::class,
RtmTableSeeder::class,
]); ]);
} }
} }

View File

@ -1,23 +0,0 @@
<?php
use Illuminate\Database\Seeder;
use App\Models\Rtm;
class RtmTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$o = new Rtm;
$o->id = 1;
$o->site_id = 1;
$o->account_id = 1;
$o->name = 'Wholesaler';
$o->save();
}
}

View File

@ -19,6 +19,9 @@ class UserTableSeeder extends Seeder
$o->language_id = 1; $o->language_id = 1;
$o->country_id = 61; $o->country_id = 61;
$o->currency_id = 610; $o->currency_id = 610;
$o->active = 1;
$o->firstname = 'Wholesaler';
$o->lastname = 'User';
$o->email = 'wholesaler@example.com'; $o->email = 'wholesaler@example.com';
$o->save(); $o->save();
@ -28,6 +31,9 @@ class UserTableSeeder extends Seeder
$o->language_id = 1; $o->language_id = 1;
$o->country_id = 61; $o->country_id = 61;
$o->currency_id = 610; $o->currency_id = 610;
$o->active = 1;
$o->firstname = 'reseller1-0';
$o->lastname = 'User';
$o->email = 'reseller1-0@example.com'; $o->email = 'reseller1-0@example.com';
$o->save(); $o->save();
@ -37,6 +43,9 @@ class UserTableSeeder extends Seeder
$o->language_id = 1; $o->language_id = 1;
$o->country_id = 61; $o->country_id = 61;
$o->currency_id = 610; $o->currency_id = 610;
$o->active = 1;
$o->firstname = 'reseller2-0';
$o->lastname = 'User';
$o->email = 'reseller2-0@example.com'; $o->email = 'reseller2-0@example.com';
$o->save(); $o->save();
@ -46,6 +55,9 @@ class UserTableSeeder extends Seeder
$o->language_id = 1; $o->language_id = 1;
$o->country_id = 61; $o->country_id = 61;
$o->currency_id = 610; $o->currency_id = 610;
$o->active = 1;
$o->firstname = 'reseller2-1';
$o->lastname = 'User';
$o->email = 'reseller2-1@example.com'; $o->email = 'reseller2-1@example.com';
$o->save(); $o->save();
@ -55,6 +67,9 @@ class UserTableSeeder extends Seeder
$o->language_id = 1; $o->language_id = 1;
$o->country_id = 61; $o->country_id = 61;
$o->currency_id = 610; $o->currency_id = 610;
$o->active = 1;
$o->firstname = 'user1-0-1';
$o->lastname = 'User';
$o->email = 'user1-0-1@example.com'; $o->email = 'user1-0-1@example.com';
$o->save(); $o->save();
@ -64,8 +79,10 @@ class UserTableSeeder extends Seeder
$o->language_id = 1; $o->language_id = 1;
$o->country_id = 61; $o->country_id = 61;
$o->currency_id = 610; $o->currency_id = 610;
$o->active = 1;
$o->firstname = 'user2-1-1';
$o->lastname = 'User';
$o->email = 'user2-1-1@example.com'; $o->email = 'user2-1-1@example.com';
$o->save(); $o->save();
} }
} }