Skip to content

Commit

Permalink
log database seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
calebbourg committed Mar 25, 2024
1 parent cb3f6a3 commit c1d3557
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions entity_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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",
Expand Down Expand Up @@ -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(),
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion migration/src/refactor_platform_rs.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- SQL dump generated using DBML (dbml-lang.org)
-- Database: PostgreSQL
-- Generated at: 2024-03-13T14:38:29.944Z
-- Generated at: 2024-03-25T17:19:11.940Z


CREATE TABLE "refactor_platform"."organizations" (
Expand Down

0 comments on commit c1d3557

Please sign in to comment.