From 96673a9e535899ce36e1be4bf69a4cff75627603 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 10 Jul 2018 13:42:17 +1000 Subject: [PATCH] Fixes for CI --- .gitlab-ci.yml | 5 +-- .../2018_07_10_034223_users_add_language.php | 38 +++++++++++++++++++ database/seeds/DatabaseSeeder.php | 1 - database/seeds/RtmTableSeeder.php | 23 ----------- database/seeds/UserTableSeeder.php | 19 +++++++++- 5 files changed, 58 insertions(+), 28 deletions(-) create mode 100644 database/migrations/2018_07_10_034223_users_add_language.php delete mode 100644 database/seeds/RtmTableSeeder.php diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index acce671..c5f8cec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -63,7 +63,6 @@ before_script: # DB_DATABASE=project_name # DB_USERNAME=root # DB_PASSWORD=secret - - cp .env.testing .env # Run npm build # comment this out if you don't have a frontend build @@ -72,8 +71,8 @@ before_script: - npm run dev # Generate an application key. Re-cache. - - php artisan key:generate - - php artisan config:cache + - php artisan key:generate --env=testing + - php artisan config:cache --env=testing # Run database migrations. - php artisan migrate diff --git a/database/migrations/2018_07_10_034223_users_add_language.php b/database/migrations/2018_07_10_034223_users_add_language.php new file mode 100644 index 0000000..2ba76df --- /dev/null +++ b/database/migrations/2018_07_10_034223_users_add_language.php @@ -0,0 +1,38 @@ +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'); + }); + } +} \ No newline at end of file diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 290cc66..732d582 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -17,7 +17,6 @@ class DatabaseSeeder extends Seeder LanguageTableSeeder::class, SiteTableSeeder::class, UserTableSeeder::class, - RtmTableSeeder::class, ]); } } diff --git a/database/seeds/RtmTableSeeder.php b/database/seeds/RtmTableSeeder.php deleted file mode 100644 index 5275e55..0000000 --- a/database/seeds/RtmTableSeeder.php +++ /dev/null @@ -1,23 +0,0 @@ -id = 1; - $o->site_id = 1; - $o->account_id = 1; - $o->name = 'Wholesaler'; - $o->save(); - } -} \ No newline at end of file diff --git a/database/seeds/UserTableSeeder.php b/database/seeds/UserTableSeeder.php index 028073d..d12d7bc 100644 --- a/database/seeds/UserTableSeeder.php +++ b/database/seeds/UserTableSeeder.php @@ -19,6 +19,9 @@ class UserTableSeeder extends Seeder $o->language_id = 1; $o->country_id = 61; $o->currency_id = 610; + $o->active = 1; + $o->firstname = 'Wholesaler'; + $o->lastname = 'User'; $o->email = 'wholesaler@example.com'; $o->save(); @@ -28,6 +31,9 @@ class UserTableSeeder extends Seeder $o->language_id = 1; $o->country_id = 61; $o->currency_id = 610; + $o->active = 1; + $o->firstname = 'reseller1-0'; + $o->lastname = 'User'; $o->email = 'reseller1-0@example.com'; $o->save(); @@ -37,6 +43,9 @@ class UserTableSeeder extends Seeder $o->language_id = 1; $o->country_id = 61; $o->currency_id = 610; + $o->active = 1; + $o->firstname = 'reseller2-0'; + $o->lastname = 'User'; $o->email = 'reseller2-0@example.com'; $o->save(); @@ -46,6 +55,9 @@ class UserTableSeeder extends Seeder $o->language_id = 1; $o->country_id = 61; $o->currency_id = 610; + $o->active = 1; + $o->firstname = 'reseller2-1'; + $o->lastname = 'User'; $o->email = 'reseller2-1@example.com'; $o->save(); @@ -55,6 +67,9 @@ class UserTableSeeder extends Seeder $o->language_id = 1; $o->country_id = 61; $o->currency_id = 610; + $o->active = 1; + $o->firstname = 'user1-0-1'; + $o->lastname = 'User'; $o->email = 'user1-0-1@example.com'; $o->save(); @@ -64,8 +79,10 @@ class UserTableSeeder extends Seeder $o->language_id = 1; $o->country_id = 61; $o->currency_id = 610; + $o->active = 1; + $o->firstname = 'user2-1-1'; + $o->lastname = 'User'; $o->email = 'user2-1-1@example.com'; $o->save(); - } } \ No newline at end of file