/** * Truncate all tables. */ protected function seedInit() { Owner::truncate(); User::truncate(); Project::truncate(); Member::truncate(); Issue::truncate(); Comment::truncate(); Moment::truncate(); Setting::truncate(); Subscriber::truncate(); }
/** * Seed the comments table. */ protected function seedComments() { $defaultComments = [['message' => ':+1: We totally nailed the fix.', 'target_type' => 'Issue', 'target_id' => 3, 'author_id' => 1, 'project_id' => 1], ['message' => ":ship: We've deployed a fix.", 'target_type' => 'MergeRequest', 'target_id' => 1, 'author_id' => 3, 'project_id' => 2], ['message' => "We've identified the problem. Our engineers are currently looking at it.", 'target_type' => 'Issue', 'target_id' => 1, 'author_id' => 2, 'project_id' => 1], ['message' => 'Something went wrong, with something or another.', 'target_type' => 'Issue', 'target_id' => 1, 'author_id' => 1, 'project_id' => 2], ['message' => ':zap: We\'ve seen high response times from our API. It looks to be fixing itself as time goes on.', 'target_type' => 'MergeRequest', 'target_id' => 1, 'author_id' => 1, 'project_id' => 3]]; Comment::truncate(); foreach ($defaultComments as $comment) { Comment::create($comment); } }