Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #196 from Prophet731/develop
Browse files Browse the repository at this point in the history
Fixed setup errors
  • Loading branch information
Prophet731 committed May 9, 2016
2 parents 3d260b6 + 8b7c66d commit 4672ae9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@

class AddRussianLanguage extends Migration
{

/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Option::count() == 0) {
if (! defined('FIRST_RUN')) {
define('FIRST_RUN', true);
}

return;
}

$setting = Option::setting('site.languages')->first();

$keys = explode(',', $setting->option_value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@

class AddPusherPermission extends Migration
{

/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Permission::count() == 0) {
if (! defined('FIRST_RUN')) {
define('FIRST_RUN', true);
}

return;
}

$now = Carbon::now();

$permissions = [
Expand Down
7 changes: 5 additions & 2 deletions app/database/seeds/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

class DatabaseSeeder extends Seeder
{

/**
* Run the database seeds.
*
Expand All @@ -19,7 +18,11 @@ public function run()
$this->call('PermissionsTableSeeder');
$this->call('UserTableSeeder');

if (defined('FIRST_RUN')) {
DB::delete("DELETE FROM `bfacp_migrations` WHERE `migration` IN ('2016_01_02_173641_add_russian_language', '2016_01_06_002532_add_pusher_permission')");
Artisan::call('migrate', ['--force' => true]);
}

DB::statement('SET FOREIGN_KEY_CHECKS=1');
}

}

0 comments on commit 4672ae9

Please sign in to comment.