Skip to content

Commit

Permalink
Add more sample datas in seeders
Browse files Browse the repository at this point in the history
Not enough diversity yet, but i might prove useful for testing request
  • Loading branch information
Dominique Vilain committed Jun 30, 2017
1 parent f1b4277 commit 951c670
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 78 deletions.
Binary file modified files/database/.DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions files/database/seeds/ImplementationsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,16 @@ public function run()
]);
}
}
for ($project_id = 1; $project_id <= 6; $project_id++) {
foreach ([2,5,8] as $student_id) {
Jiri\Implementation::create([
'project_id' => $project_id,
'student_id' => $student_id,
'url_project' => 'http://',
'url_repo' => 'http://www.github.com/',
'event_id' => 2
]);
}
}
}
}
80 changes: 80 additions & 0 deletions files/database/seeds/MeetingsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,86 @@ public function run()
'end_time' => null,
'general_evaluation' => 12
]);
Jiri\Meeting::create([
'user_id' => 3,
'student_id' => 2,
'event_id' => 2,
'start_time' => null,
'end_time' => null,
'general_evaluation' => null
]);
Jiri\Meeting::create([
'user_id' => 3,
'student_id' => 5,
'event_id' => 2,
'start_time' => null,
'end_time' => null,
'general_evaluation' => null
]);
Jiri\Meeting::create([
'user_id' => 3,
'student_id' => 8,
'event_id' => 2,
'start_time' => null,
'end_time' => null,
'general_evaluation' => null
]);
Jiri\Meeting::create([
'user_id' => 15,
'student_id' => 5,
'event_id' => 2,
'start_time' => null,
'end_time' => null,
'general_evaluation' => null
]);
Jiri\Meeting::create([
'user_id' => 15,
'student_id' => 8,
'event_id' => 2,
'start_time' => null,
'end_time' => null,
'general_evaluation' => null
]);
Jiri\Meeting::create([
'user_id' => 5,
'student_id' => 2,
'event_id' => 2,
'start_time' => null,
'end_time' => null,
'general_evaluation' => null
]);
Jiri\Meeting::create([
'user_id' => 5,
'student_id' => 5,
'event_id' => 2,
'start_time' => null,
'end_time' => null,
'general_evaluation' => null
]);
Jiri\Meeting::create([
'user_id' => 5,
'student_id' => 8,
'event_id' => 2,
'start_time' => null,
'end_time' => null,
'general_evaluation' => null
]);
Jiri\Meeting::create([
'user_id' => 6,
'student_id' => 8,
'event_id' => 2,
'start_time' => null,
'end_time' => null,
'general_evaluation' => null
]);
Jiri\Meeting::create([
'user_id' => 7,
'student_id' => 2,
'event_id' => 2,
'start_time' => null,
'end_time' => null,
'general_evaluation' => null
]);

}
}
15 changes: 15 additions & 0 deletions files/database/seeds/PerformancesTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,20 @@ public function run()
'student_id' => 10,
'event_id' => 1
]);
\Jiri\Performance::create([
'manual_score' => null,
'student_id' => 2,
'event_id' => 2
]);
\Jiri\Performance::create([
'manual_score' => null,
'student_id' => 5,
'event_id' => 2
]);
\Jiri\Performance::create([
'manual_score' => null,
'student_id' => 8,
'event_id' => 2
]);
}
}
3 changes: 3 additions & 0 deletions files/database/seeds/ProjectsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@ public function run()
\Jiri\Project::create([
'name' => 'Pré-production du PFE',
]);
\Jiri\Project::create([
'name' => 'Jiri',
]);
}
}
75 changes: 1 addition & 74 deletions files/database/seeds/ScoresTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,79 +11,6 @@ class ScoresTableSeeder extends Seeder
*/
public function run()
{
/*
* //Léa Vérou cote le CV
\Jiri\Score::create([
'meeting_id' => 1,
'implementation_id' => 1,
'score' => 8
]);
\Jiri\Score::create([
'meeting_id' => 2,
'implementation_id' => 2,
'score' => 17
]);
\Jiri\Score::create([
'meeting_id' => 3,
'implementation_id' => 3,
'score' => 20
]);
\Jiri\Score::create([
'meeting_id' => 4,
'implementation_id' => 5,
'score' => 7.5
]);
\Jiri\Score::create([
'meeting_id' => 5,
'implementation_id' => 7,
'score' => 9
]);
\Jiri\Score::create([
'meeting_id' => 6,
'implementation_id' => 8,
'score' => 8
]);
\Jiri\Score::create([
'meeting_id' => 7,
'implementation_id' => 9,
'score' => 10
]);
//Léa Vérou cote CSSZG
\Jiri\Score::create([
'meeting_id' => 8,
'implementation_id' => 11,
'score' => 8
]);
\Jiri\Score::create([
'meeting_id' => 9,
'implementation_id' => 12,
'score' => 15
]);
\Jiri\Score::create([
'meeting_id' => 10,
'implementation_id' => 13,
'score' => 19.5
]);
\Jiri\Score::create([
'meeting_id' => 11,
'implementation_id' => 15,
'score' => 7.5
]);
\Jiri\Score::create([
'meeting_id' => 12,
'implementation_id' => 17,
'score' => 9
]);
\Jiri\Score::create([
'meeting_id' => 13,
'implementation_id' => 18,
'score' => 0
]);
\Jiri\Score::create([
'meeting_id' => 14,
'implementation_id' => 19,
'score' => 12
]);*/
if (($handle = fopen(database_path() . "/seeds/jury-dashboard.csv", "r")) !== false) {
$table = [];
while (($data = fgetcsv($handle, 1000, ";")) !== false) {
Expand Down Expand Up @@ -113,7 +40,7 @@ public function run()
'score' => $table[$student_id][$j],
'meeting_id' => $meeting_id,
'implementation_id' => $implementation_id,
'comment' => ''
'comment' => null
]);
}
}
Expand Down
36 changes: 32 additions & 4 deletions files/database/seeds/UsersTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ public function run()
'name' => 'Mariam Faso',
'email' => '[email protected]',
'password' => Hash::make('azerty'),
'company' => ''
'company' => null
]);
\Jiri\User::create([
'is_admin' => 0,
'name' => 'Vincent De Oliveira',
'email' => '[email protected]',
'password' => Hash::make('azerty'),
'company' => ''
'company' => null
]);
\Jiri\User::create([
'is_admin' => 0,
Expand All @@ -79,7 +79,7 @@ public function run()
'name' => 'Molly Holzschlag',
'email' => '[email protected]',
'password' => Hash::make('azerty'),
'company' => ''
'company' => null
]);
\Jiri\User::create([
'is_admin' => 0,
Expand All @@ -93,7 +93,7 @@ public function run()
'name' => 'Taylor Otwell',
'email' => '[email protected]',
'password' => Hash::make('azerty'),
'company' => ''
'company' => null
]);
\Jiri\User::create([
'is_admin' => 0,
Expand All @@ -116,5 +116,33 @@ public function run()
'password' => Hash::make('azerty'),
'company' => 'CSIA'
]);
\Jiri\User::create([
'is_admin' => 0,
'name' => 'Matt Stauffer',
'email' => '[email protected]',
'password' => Hash::make('azerty'),
'company' => null
]);
\Jiri\User::create([
'is_admin' => 0,
'name' => 'Jeffrey Zeldman',
'email' => '[email protected]',
'password' => Hash::make('azerty'),
'company' => 'A list apart'
]);
\Jiri\User::create([
'is_admin' => 0,
'name' => 'Jason Santa Maria',
'email' => '[email protected]',
'password' => Hash::make('azerty'),
'company' => null
]);
\Jiri\User::create([
'is_admin' => 0,
'name' => 'Jeremy Keith',
'email' => '[email protected]',
'password' => Hash::make('azerty'),
'company' => 'clearleft'
]);
}
}
15 changes: 15 additions & 0 deletions files/database/seeds/WeightsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,20 @@ public function run()
'project_id' => 6,
'event_id' => 1,
]);
\Jiri\Weight::create([
'weight' => 3,
'project_id' => 7,
'event_id' => 3,
]);
\Jiri\Weight::create([
'weight' => 3,
'project_id' => 8,
'event_id' => 3,
]);
\Jiri\Weight::create([
'weight' => 4,
'project_id' => 10,
'event_id' => 3,
]);
}
}

0 comments on commit 951c670

Please sign in to comment.