Skip to content

Commit

Permalink
Support default agency id
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Mar 29, 2024
1 parent d7a7489 commit 414cb4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/maple/gtfs_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub async fn gtfs_process_feed(

let agency_row = catenary::models::Agency {
static_onestop_id: feed_id.to_string(),
agency_id: agency.id.clone(),
agency_id: agency.id.clone().unwrap_or_else(|| "".to_string()),
attempt_id: attempt_id.to_string(),
agency_name: agency.name.clone(),
agency_name_translations: None,
Expand Down
2 changes: 1 addition & 1 deletion src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub struct IngestedStatic {
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct Agency {
pub static_onestop_id: String,
pub agency_id: Option<String>,
pub agency_id: String,
pub attempt_id: String,
pub agency_name: String,
pub agency_name_translations: Option<Value>,
Expand Down
4 changes: 2 additions & 2 deletions src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ pub mod gtfs {
use diesel::sql_types::*;
use crate::custom_pg_types::*;

gtfs.agencies (static_onestop_id, attempt_id) {
gtfs.agencies (static_onestop_id, attempt_id, agency_id) {
static_onestop_id -> Text,
agency_id -> Nullable<Text>,
agency_id -> Text,
attempt_id -> Text,
agency_name -> Text,
agency_name_translations -> Nullable<Jsonb>,
Expand Down

0 comments on commit 414cb4a

Please sign in to comment.