Skip to content

Commit

Permalink
Improve error message for parsing timestamp fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurshsmith committed Dec 30, 2023
1 parent 2cb86be commit e71bb18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chaindexing/src/contract_states/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ fn get_unique_index_migration_for_state_versions(
}

fn validate_migration(migration: &str) {
let invalid_migration_keywords = [" timestamp", " timestampz", " date", " time"];
let invalid_migration_keywords = [" timestamp", " timestamptz", " date", " time"];

invalid_migration_keywords.iter().for_each(|keyword| {
if migration.to_lowercase().contains(keyword) {
panic!("{keyword} tyoe of fields cannot be indexed")
panic!("{keyword} tyoe of fields cannot be indexed. Consider using Unix time for timestamp fields.")
}
});
}
Expand Down

0 comments on commit e71bb18

Please sign in to comment.