Skip to content

Commit 1f43fb3

Browse files
committed
Make the database seeder better
1 parent 31545ca commit 1f43fb3

File tree

1 file changed

+28
-19
lines changed

1 file changed

+28
-19
lines changed

database/seeders/DatabaseSeeder.php

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,48 +57,48 @@ public function run(): void
5757
]);
5858

5959
Schedule::create([
60-
'name' => 'Database Maintenance',
61-
'message' => 'We will be conducting maintenance on our database servers. You may experience degraded performance during this time.',
60+
'name' => 'Documentation Maintenance',
61+
'message' => 'We will be conducting maintenance on our documentation servers. You may experience degraded performance during this time.',
6262
'scheduled_at' => now()->addHours(24),
6363
'completed_at' => null,
6464
]);
6565

6666
$componentGroup = ComponentGroup::create([
67-
'name' => 'Checkmango',
67+
'name' => 'Cachet',
6868
'collapsed' => ComponentGroupVisibilityEnum::expanded,
6969
'visible' => ResourceVisibilityEnum::guest,
7070
]);
7171

7272
$componentGroup->components()->createMany([
7373
[
74-
'name' => 'Dashboard',
75-
'description' => 'The Checkmango Dashboard.',
76-
'link' => 'https://checkmango.com',
74+
'name' => 'Cachet Website',
75+
'description' => 'The Cachet Website.',
76+
'link' => 'https://cachethq.io',
7777
'status' => ComponentStatusEnum::operational,
7878
], [
79-
'name' => 'API',
80-
'description' => 'The Checkmango API.',
81-
'link' => 'https://developers.checkmango.com',
79+
'name' => 'Cachet Documentation',
80+
'description' => 'The Checkmango Documentation.',
81+
'link' => 'https://docs.cachethq.io',
8282
'status' => ComponentStatusEnum::operational,
8383
], [
84-
'name' => 'Documentation',
85-
'description' => 'The Checkmango Documentation.',
86-
'link' => 'https://docs.checkmango.com',
87-
'status' => ComponentStatusEnum::performance_issues,
84+
'name' => 'Cachet Blog',
85+
'description' => 'The Cachet Blog.',
86+
'link' => 'https://blog.cachethq.io',
87+
'status' => ComponentStatusEnum::operational,
8888
],
8989
]);
9090

9191
Component::create([
92-
'name' => 'Cachet',
93-
'description' => 'The open-source status page system.',
94-
'link' => 'https://cachethq.io',
92+
'name' => 'Laravel Artisan Cheatsheet',
93+
'description' => 'The Laravel Artisan Cheatsheet.',
94+
'link' => 'https://artisan.page',
9595
'status' => ComponentStatusEnum::operational,
9696
]);
9797

9898
$metric = Metric::create([
99-
'name' => 'Checkmango Requests',
99+
'name' => 'Cachet API Requests',
100100
'suffix' => 'req/s',
101-
'description' => 'The number of requests to the Checkmango API.',
101+
'description' => 'The number of requests to the Cachet API.',
102102
'default_view' => MetricViewEnum::last_hour,
103103
'calc_type' => MetricTypeEnum::average,
104104
'display_chart' => true,
@@ -147,7 +147,7 @@ public function run(): void
147147
$incident = Incident::create([
148148
'name' => 'Documentation Performance Degradation',
149149
'message' => 'We\'re investigating an issue with our documentation causing the site to be slow.',
150-
'status' => IncidentStatusEnum::investigating,
150+
'status' => IncidentStatusEnum::fixed,
151151
'visible' => ResourceVisibilityEnum::guest,
152152
'guid' => Str::uuid(),
153153
'created_at' => $timestamp = now()->subMinutes(30),
@@ -158,6 +158,15 @@ public function run(): void
158158
$incident->incidentUpdates()->create([
159159
'status' => IncidentStatusEnum::identified,
160160
'message' => 'We\'ve identified the issue and are working on a fix.',
161+
'created_at' => $timestamp = $incident->created_at->addMinutes(15),
162+
'updated_at' => $timestamp,
163+
]);
164+
165+
$incident->incidentUpdates()->create([
166+
'status' => IncidentStatusEnum::fixed,
167+
'message' => 'The documentation is now back online. Happy reading!',
168+
'created_at' => $timestamp = $incident->created_at->addMinutes(25),
169+
'updated_at' => $timestamp,
161170
]);
162171

163172
IncidentTemplate::create([

0 commit comments

Comments
 (0)