Commit a3046ab6 authored by Jack Stupple's avatar Jack Stupple

disable currencies unsupported at the moment and only emily and jake

parent a48b3ef5
......@@ -179,26 +179,7 @@ class Initial extends Migration
}
);
DB::table('languages')->insert([
'name' => 'English',
'slug' => 'en',
'enabled' => $this->created_at,
'created_at' => $this->created_at
]);
DB::table('languages')->insert([
'name' => 'Dutch',
'slug' => 'nl',
'enabled' => $this->created_at,
'created_at' => $this->created_at
]);
DB::table('languages')->insert([
'name' => 'German',
'slug' => 'de',
'enabled' => $this->created_at,
'created_at' => $this->created_at
]);
$this->addSupportedLanguages();
$this->language = \App\Language::where('slug', 'en')->first();
......@@ -289,14 +270,7 @@ class Initial extends Migration
}
);
$modifier_categories = static::$modifier_categories;
foreach ($modifier_categories as &$category) {
if (isset($category['icon'])) {
$category['icon'] = '/modifiers/' . $category['icon'];
}
}
DB::table('modifier_categories')->insert($modifier_categories);
$this->addModifierCategories();
Schema::create(
'questions',
......@@ -321,12 +295,7 @@ class Initial extends Migration
}
);
$question_categories = static::$question_categories;
foreach ($question_categories as &$category) {
$category['icon'] = '/question-categories/' . $category['icon'];
}
DB::table('question_categories')->insert($question_categories);
$this->addQuestionCategories();
Schema::create(
'answers',
......@@ -371,6 +340,71 @@ class Initial extends Migration
);
}
protected function addSupportedLanguages()
{
$en = \App\Language::firstOrCreate([
'name' => 'English',
'slug' => 'en'
]);
$en->enabled = $this->created_at;
$en->save();
$nl = \App\Language::firstOrCreate([
'name' => 'Dutch',
'slug' => 'nl'
]);
$nl->enabled = $this->created_at;
$nl->save();
$de = \App\Language::firstOrCreate([
'name' => 'German',
'slug' => 'de'
]);
$de->enabled = $this->created_at;
$de->save();
$no = \App\Language::firstOrCreate([
'name' => 'Norwegian',
'slug' => 'no'
]);
$no->enabled = $this->created_at;
$no->save();
$sl = \App\Language::firstOrCreate([
'name' => 'Slovenian',
'slug' => 'sl'
]);
$sl->enabled = $this->created_at;
$sl->save();
}
protected function addQuestionCategories()
{
$question_categories = static::$question_categories;
foreach ($question_categories as &$category) {
$category['icon'] = '/question-categories/' . $category['icon'];
}
DB::table('question_categories')->insert($question_categories);
}
protected function addModifierCategories()
{
$modifier_categories = static::$modifier_categories;
foreach ($modifier_categories as &$category) {
if (isset($category['icon'])) {
$category['icon'] = '/modifiers/' . $category['icon'];
}
}
DB::table('modifier_categories')->insert($modifier_categories);
}
/**
* Reverse the migrations.
*
......
......@@ -24,14 +24,6 @@ class CreateCurrenciesTable extends Migration
$currency = new Currency();
$currency->currency_code = 'EUR';
$currency->save();
$currency = new Currency();
$currency->currency_code = 'GBP';
$currency->save();
$currency = new Currency();
$currency->currency_code = 'NOK';
$currency->save();
}
/**
......
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddNewSupportedLanguages extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$now = date('Y-m-d H:i:s');
$no = \App\Language::firstOrCreate([
'name' => 'Norwegian',
'slug' => 'no'
]);
$no->enabled = $now;
$no->save();
$sl = \App\Language::firstOrCreate([
'name' => 'Slovenian',
'slug' => 'sl'
]);
$sl->enabled = $now;
$sl->save();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$de = \App\Language::where('slug', 'de')->first();
if ($de) {
$de->enabled = null;
$de->save();
}
$no = \App\Language::where('slug', 'no')->first();
if ($no) {
$no->enabled = null;
$no->save();
}
}
}
......@@ -22,7 +22,6 @@ class ImportJakeQuestions extends CharacterMigration
*/
public function up()
{
return;
$this->created_at = date('Y-m-d H:i:s');
$this->character = new \App\Character();
......
......@@ -15,7 +15,7 @@ class AddSocialText extends Migration
*/
public function up()
{
foreach (['emily', 'jake', 'jamal', 'ann'] as $_character) {
foreach (['emily', 'jake'] as $_character) {
$character = \App\Character::where('name', 'LIKE', $_character)->first();
$json_path = APP_ROOT . '/resources/data/' . $_character . '/social-statuses.json';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment