This commit is contained in:
Graham Campbell
2014-12-20 21:20:17 +00:00
parent 26e4361d8a
commit 9d8d89248f
103 changed files with 2478 additions and 2353 deletions
@@ -1,40 +1,39 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateIncidentsTable extends Migration {
class CreateIncidentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('incidents', function(Blueprint $table)
{
$table->increments('id');
$table->tinyInteger('component')->default(1);
$table->string('name');
$table->tinyInteger('status')->default(1);
$table->longText('message');
$table->timestamps();
$table->softDeletes();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('incidents', function (Blueprint $table) {
$table->increments('id');
$table->tinyInteger('component')->default(1);
$table->string('name');
$table->tinyInteger('status')->default(1);
$table->longText('message');
$table->timestamps();
$table->softDeletes();
$table->index('component');
$table->index('status');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('incidents');
}
$table->index('component');
$table->index('status');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('incidents');
}
}
@@ -1,37 +1,36 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateComponentsTable extends Migration {
class CreateComponentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('components', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('description')->nullable()->default(null);
$table->tinyInteger('status')->default(1);
$table->timestamps();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('components', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('description')->nullable()->default(null);
$table->tinyInteger('status')->default(1);
$table->timestamps();
$table->index('status');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('components');
}
$table->index('status');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('components');
}
}
@@ -1,34 +1,33 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSettingsTable extends Migration {
class CreateSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->text('value')->nullable()->default(null);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->text('value')->nullable()->default(null);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings');
}
}
@@ -1,41 +1,40 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateWebHooksTable extends Migration {
class CreateWebHooksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('web_hooks', function(Blueprint $table)
{
$table->increments('id');
$table->string('name')->nullable(FALSE);
$table->string('endpoint')->nullable(FALSE);
$table->tinyInteger('hook_type')->default(0); // When should this web hook be called?
$table->tinyInteger('request_type')->default(0); // ENUM: GET, POST, PUT, DELETE etc
$table->boolean('active')->default(0);
$table->timestamps();
$table->softDeletes();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('web_hooks', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->nullable(false);
$table->string('endpoint')->nullable(false);
$table->tinyInteger('hook_type')->default(0); // When should this web hook be called?
$table->tinyInteger('request_type')->default(0); // ENUM: GET, POST, PUT, DELETE etc
$table->boolean('active')->default(0);
$table->timestamps();
$table->softDeletes();
// Indexes
$table->index('active');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('web_hooks');
}
// Indexes
$table->index('active');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('web_hooks');
}
}
@@ -1,42 +1,41 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateWebHookResponsesTable extends Migration {
class CreateWebHookResponsesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('web_hook_response', function(Blueprint $table)
{
$table->increments('id');
$table->integer('hook_id')->unsigned();
$table->tinyInteger('response_code')->nullable(FALSE); // This should return something like 200, 301 etc.
$table->string('response_type'); // application/json etc.
$table->text('sent_headers');
$table->longText('sent_body'); // What we sent the web hook
$table->text('recv_headers');
$table->longText('recv_body'); // Potentially a big response will be returned
$table->float('time_taken')->default(0); // How long did the request take, in seconds.
$table->timestamps();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('web_hook_response', function (Blueprint $table) {
$table->increments('id');
$table->integer('hook_id')->unsigned();
$table->tinyInteger('response_code')->nullable(false); // This should return something like 200, 301 etc.
$table->string('response_type'); // application/json etc.
$table->text('sent_headers');
$table->longText('sent_body'); // What we sent the web hook
$table->text('recv_headers');
$table->longText('recv_body'); // Potentially a big response will be returned
$table->float('time_taken')->default(0); // How long did the request take, in seconds.
$table->timestamps();
$table->index('hook_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('web_hook_response');
}
$table->index('hook_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('web_hook_response');
}
}
@@ -1,41 +1,40 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateUsersTable extends Migration {
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function(Blueprint $table)
{
$table->increments('id');
$table->string('username', 200)->nullable(false);
$table->string('password')->nullable(false);
$table->rememberToken();
$table->string('email')->nullable()->default(null);
$table->boolean('active')->default(1);
$table->tinyInteger('level')->default(2);
$table->timestamps();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('username', 200)->nullable(false);
$table->string('password')->nullable(false);
$table->rememberToken();
$table->string('email')->nullable()->default(null);
$table->boolean('active')->default(1);
$table->tinyInteger('level')->default(2);
$table->timestamps();
$table->index('remember_token');
$table->index('active');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
$table->index('remember_token');
$table->index('active');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}
@@ -1,38 +1,37 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateIncidentTemplatesTable extends Migration {
class CreateIncidentTemplatesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('incident_templates', function(Blueprint $table)
{
$table->increments('id');
$table->string('name')->nullable(false);
$table->string('slug', 50)->nullable(false);
$table->longText('template')->nullable(false);
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('incident_templates', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->nullable(false);
$table->string('slug', 50)->nullable(false);
$table->longText('template')->nullable(false);
$table->timestamps();
$table->timestamps();
$table->index('slug');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('incident_templates');
}
$table->index('slug');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('incident_templates');
}
}
@@ -1,36 +1,35 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateMetricsTable extends Migration {
class CreateMetricsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('metrics', function(Blueprint $table)
{
$table->increments('id');
$table->string('name')->nullable(false);
$table->string('suffix')->nullable(false);
$table->string('description')->nullable(false);
$table->boolean('display_chart')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('metrics');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('metrics', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->nullable(false);
$table->string('suffix')->nullable(false);
$table->string('description')->nullable(false);
$table->boolean('display_chart')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('metrics');
}
}
@@ -1,36 +1,35 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateMetricPointsTable extends Migration {
class CreateMetricPointsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('metric_points', function(Blueprint $table)
{
$table->increments('id');
$table->integer('metric_id')->unsigned();
$table->integer('value')->unsigned();
$table->timestamps();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('metric_points', function (Blueprint $table) {
$table->increments('id');
$table->integer('metric_id')->unsigned();
$table->integer('value')->unsigned();
$table->timestamps();
$table->foreign('metric_id')->references('id')->on('metrics');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('metric_points');
}
$table->foreign('metric_id')->references('id')->on('metrics');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('metric_points');
}
}
@@ -1,36 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class UserIdColumnForComponents extends Migration {
class UserIdColumnForComponents extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('components', function(Blueprint $table)
{
$table->unsignedInteger('user_id')->nullable();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('components', function (Blueprint $table) {
$table->unsignedInteger('user_id')->nullable();
$table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('NO ACTION');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('components', function(Blueprint $table)
{
$table->dropColumn('user_id');
});
}
$table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('NO ACTION');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('components', function (Blueprint $table) {
$table->dropColumn('user_id');
});
}
}
@@ -1,36 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class UserIdColumnForIncidents extends Migration {
class UserIdColumnForIncidents extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function(Blueprint $table)
{
$table->unsignedInteger('user_id')->nullable();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function (Blueprint $table) {
$table->unsignedInteger('user_id')->nullable();
$table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('NO ACTION');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function(Blueprint $table)
{
$table->dropColumn('user_id');
});
}
$table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('NO ACTION');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function (Blueprint $table) {
$table->dropColumn('user_id');
});
}
}
@@ -1,34 +1,33 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSubscribersTable extends Migration {
class CreateSubscribersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('subscribers', function(Blueprint $table)
{
$table->increments('id');
$table->string('email')->nullable(false);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('subscribers');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('subscribers', function (Blueprint $table) {
$table->increments('id');
$table->string('email')->nullable(false);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('subscribers');
}
}
@@ -1,37 +1,36 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateServicesTable extends Migration {
class CreateServicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('services', function(Blueprint $table)
{
$table->increments('id');
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('services', function (Blueprint $table) {
$table->increments('id');
$table->string('type')->nullable(false);
$table->boolean('active')->default(0); // Inactive by default
$table->text('properties')->nullable(true);
$table->string('type')->nullable(false);
$table->boolean('active')->default(0); // Inactive by default
$table->text('properties')->nullable(true);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('services');
}
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('services');
}
}
@@ -1,34 +1,32 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AlterTableIncidentsRenameComponentColumn extends Migration {
class AlterTableIncidentsRenameComponentColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function(Blueprint $table)
{
DB::statement("ALTER TABLE `incidents` CHANGE `component` `component_id` TINYINT(4) NOT NULL DEFAULT '1'");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function(Blueprint $table)
{
DB::statement("ALTER TABLE `incidents` CHANGE `component_id` `component` TINYINT(4) NOT NULL DEFAULT '1'");
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function (Blueprint $table) {
DB::statement("ALTER TABLE `incidents` CHANGE `component` `component_id` TINYINT(4) NOT NULL DEFAULT '1'");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function (Blueprint $table) {
DB::statement("ALTER TABLE `incidents` CHANGE `component_id` `component` TINYINT(4) NOT NULL DEFAULT '1'");
});
}
}
@@ -1,35 +1,33 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AlterIncidentsTableMoveUserIdColumn extends Migration {
class AlterIncidentsTableMoveUserIdColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function(Blueprint $table)
{
DB::statement('ALTER TABLE `incidents` MODIFY COLUMN `user_id` INT(10) UNSIGNED DEFAULT NULL AFTER `component_id`;');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function (Blueprint $table) {
DB::statement('ALTER TABLE `incidents` MODIFY COLUMN `user_id` INT(10) UNSIGNED DEFAULT NULL AFTER `component_id`;');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function(Blueprint $table)
{
DB::statement('ALTER TABLE `incidents` MODIFY COLUMN `user_id` INT(10) UNSIGNED DEFAULT NULL AFTER `deleted_at`;');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function (Blueprint $table) {
DB::statement('ALTER TABLE `incidents` MODIFY COLUMN `user_id` INT(10) UNSIGNED DEFAULT NULL AFTER `deleted_at`;');
});
}
}
@@ -1,34 +1,32 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AlterTableIncidentsRemoveDefaultComponent extends Migration {
class AlterTableIncidentsRemoveDefaultComponent extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function(Blueprint $table)
{
DB::statement("ALTER TABLE `incidents` CHANGE `component_id` `component_id` TINYINT(4) NOT NULL DEFAULT '0';");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function(Blueprint $table)
{
DB::statement("ALTER TABLE `incidents` CHANGE `component_id` `component_id` TINYINT(4) NOT NULL DEFAULT '1';");
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function (Blueprint $table) {
DB::statement("ALTER TABLE `incidents` CHANGE `component_id` `component_id` TINYINT(4) NOT NULL DEFAULT '0';");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function (Blueprint $table) {
DB::statement("ALTER TABLE `incidents` CHANGE `component_id` `component_id` TINYINT(4) NOT NULL DEFAULT '1';");
});
}
}
@@ -2,31 +2,30 @@
use Illuminate\Database\Migrations\Migration;
class CreateSessionTable extends Migration {
class CreateSessionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sessions', function($t)
{
$t->string('id')->unique();
$t->text('payload');
$t->integer('last_activity');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('sessions');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sessions', function ($t) {
$t->string('id')->unique();
$t->text('payload');
$t->integer('last_activity');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('sessions');
}
}
@@ -1,28 +1,29 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AlterTableComponentsAddDeletedAt extends Migration {
class AlterTableComponentsAddDeletedAt extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::table('components', function(Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('components', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}
+32 -31
View File
@@ -1,38 +1,39 @@
<?php
class ComponentTableSeeder extends Seeder {
class ComponentTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$defaultComponents = [
[
"name" => "API",
"description" => "Used by third-parties to connect to us",
"status" => 1,
"user_id" => 1
], [
"name" => "Payments",
"description" => "Backed by Stripe",
"status" => 1,
"user_id" => 1
], [
"name" => "Website",
"status" => 1,
"user_id" => 1
]
];
$defaultComponents = [
[
"name" => "API",
"description" => "Used by third-parties to connect to us",
"status" => 1,
"user_id" => 1,
], [
"name" => "Payments",
"description" => "Backed by Stripe",
"status" => 1,
"user_id" => 1
], [
"name" => "Website",
"status" => 1,
"user_id" => 1
],
];
Component::truncate();
Component::truncate();
foreach($defaultComponents as $component) {
Component::create($component);
}
}
foreach ($defaultComponents as $component) {
Component::create($component);
}
}
}
+14 -14
View File
@@ -1,19 +1,19 @@
<?php
class DatabaseSeeder extends Seeder {
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->call('SettingsTableSeeder');
$this->call('IncidentTableSeeder');
$this->call('ComponentTableSeeder');
}
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->call('SettingsTableSeeder');
$this->call('IncidentTableSeeder');
$this->call('ComponentTableSeeder');
}
}
+44 -43
View File
@@ -1,50 +1,51 @@
<?php
class IncidentTableSeeder extends Seeder {
class IncidentTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$defaultIncidents = [
[
"name" => "Test Incident",
"message" => "Something went wrong, oh noes.",
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Update",
"message" => "We've found the problem, so we're looking at it.",
"status" => 2,
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Monitoring the fix",
"message" => "We're checking that our fix will first work.",
"status" => 3,
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Awesome",
"message" => "We totally nailed the fix.",
"status" => 4,
"component_id" => 2,
"user_id" => 1,
]
];
$defaultIncidents = [
[
"name" => "Test Incident",
"message" => "Something went wrong, oh noes.",
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Update",
"message" => "We've found the problem, so we're looking at it.",
"status" => 2,
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Monitoring the fix",
"message" => "We're checking that our fix will first work.",
"status" => 3,
"component_id" => 1,
"user_id" => 1,
],
[
"name" => "Awesome",
"message" => "We totally nailed the fix.",
"status" => 4,
"component_id" => 2,
"user_id" => 1,
],
];
Incident::truncate();
Incident::truncate();
foreach($defaultIncidents as $incident) {
Incident::create($incident);
}
}
foreach ($defaultIncidents as $incident) {
Incident::create($incident);
}
}
}
+21 -20
View File
@@ -1,27 +1,28 @@
<?php
class SettingsTableSeeder extends Seeder {
class SettingsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$defaultSettings = [
[
"name" => "site_name",
"value" => "Test"
]
];
$defaultSettings = [
[
"name" => "site_name",
"value" => "Test",
],
];
Setting::truncate();
Setting::truncate();
foreach($defaultSettings as $setting) {
Setting::create($setting);
}
}
foreach ($defaultSettings as $setting) {
Setting::create($setting);
}
}
}