Skip to content

Commit

Permalink
Merge 6205174 into 42fcca9
Browse files Browse the repository at this point in the history
  • Loading branch information
karolisg committed Feb 6, 2023
2 parents 42fcca9 + 6205174 commit 2a9285c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dozer-ingestion/src/connectors/postgres/schema_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::connectors::{TableInfo, ValidationResults};
use crate::connectors::postgres::connection::helper;
use crate::connectors::postgres::helper::postgres_type_to_dozer_type;
use crate::errors::PostgresSchemaError::{
InvalidColumnType, SchemaReplicationIdentityError, ValueConversionError,
InvalidColumnType, PrimaryKeyIsMissingInSchema, ValueConversionError,
};

use postgres_types::Type;
Expand Down Expand Up @@ -173,7 +173,7 @@ impl SchemaHelper {
.find(|(_table_name, schema, _)| schema.primary_index.is_empty());

match table_without_primary_index {
Some((table_name, _, _)) => Err(SchemaReplicationIdentityError(table_name.clone())),
Some((table_name, _, _)) => Err(PrimaryKeyIsMissingInSchema(table_name.clone())),
None => Ok(()),
}
}
Expand Down
4 changes: 2 additions & 2 deletions dozer-ingestion/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ pub enum PostgresConnectorError {

#[derive(Error, Debug, Eq, PartialEq)]
pub enum PostgresSchemaError {
#[error("Schema's '{0}' replication identity settings is not correct. It is either not set or NOTHING")]
SchemaReplicationIdentityError(String),
#[error("Schema's '{0}' doesnt have primary key")]
PrimaryKeyIsMissingInSchema(String),

#[error("Column type {0} not supported")]
ColumnTypeNotSupported(String),
Expand Down

0 comments on commit 2a9285c

Please sign in to comment.