I've been reading on data preparation recommendati...
# gd-beginners
k
I've been reading on data preparation recommendations in your docs and where the section Recommended Naming Conventions at https://www.gooddata.com/docs/cloud/model-data/prepare-your-data/ says: "We recommend you name the columns in your tables a certain way by adding a specific prefix to each column name...", it includes prefixes for primary and reference keys. But a few paragraphs down, the section https://www.gooddata.com/docs/cloud/model-data/prepare-your-data/#PrepareYourData-NamingConventionsvsReferentialIntegrity says "Do not apply the naming conventions to the columns that are used as or are included in a primary key or a foreign key in your database". I can't quite reconcile these. thanks
m
Hi Kurt, if your database enforces referential integrity through primary and foreign key constraints, do not apply these naming conventions to columns used as primary or foreign keys. This is because altering column names to include prefixes might break the existing constraints and relationships defined in your database schema. If your database doesn’t enforce referential integrity (there are no primary or foreign key constraints), it’s recommended using naming conventions. But if your database enforces referential integrity, maintain the original column names to preserve these relationships.
k
Ok, this is a strange comment to have in the docs because even changing a column name that's not a key could affect other users of the database... so really you're just saying to make sure you know what you're doing before changing any column names, whether they're keys or referenced in some other way... It seems to me unless no other entity is relying on the database, preparing it for use with GoodData's recommended column names means creating new views or a replica of the database. The docs are also confusing because the first section I cite specifically gives examples of renaming primary and reference keys...
m
Hi Kurt, the advise is based on the assumption that the table or view you're using is for specifically creating the LDM in GoodData. If there are other users that would be confused or affected by the renaming, it is better to either use the default configuration, or create a specific view or table where you could follow the recommended naming convention.