-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb3f6a3
commit c1d3557
Showing
2 changed files
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ use serde_json::json; | |
use entity::coaching_relationships; | ||
use entity::organizations; | ||
use entity::users; | ||
use log::*; | ||
|
||
pub mod coaching_relationship; | ||
pub mod error; | ||
|
@@ -14,6 +15,9 @@ pub mod user; | |
pub async fn seed_database(db: &DatabaseConnection) { | ||
let now = Utc::now(); | ||
|
||
info!("Seeding database with initial data"); | ||
info!("Creating Users"); | ||
|
||
let jim_hodapp_params = json!({ | ||
"email": "[email protected]", | ||
"first_name": "Jim", | ||
|
@@ -59,6 +63,8 @@ pub async fn seed_database(db: &DatabaseConnection) { | |
let caleb_bourg = user::create(db, caleb_bourg_active_model).await.unwrap(); | ||
let other_user = user::create(db, other_user_active_model).await.unwrap(); | ||
|
||
info!("Creating Organizations"); | ||
|
||
let jim_hodapp_coaching_params = json!({ | ||
"name": "Jim Hodapp's Coaching", | ||
"external_id": Uuid::new_v4(), | ||
|
@@ -85,6 +91,8 @@ pub async fn seed_database(db: &DatabaseConnection) { | |
.await | ||
.unwrap(); | ||
|
||
info!("Creating Coaching Relationships"); | ||
|
||
let jim_hodapp_coaching_coaching_relationship_params = json!({ | ||
"coach_id": jim_hodapp.id, | ||
"coachee_id": caleb_bourg.id, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters