Avoid repeating inferred types

When we have relations on tables we presumes that the referenced field has the same type that source so we can omit the type on the reference. This can be a simple way to maintain coherence between relation types. We can still providing diferent types on some cases.

Before

Table users {
    id integer [pk]
}

Table posts {
    id integer [pk]
    user_id integer [ref: > users.id]
}

Table reviews {
    id integer [pk]
    user_id integer  [ref: > users.id]
}

Table users_extension {
  id integer [ref: - users.id]
  some_field varchar
}

After

Table users {
    id integer [pk]
}

Table posts {
    id integer [pk]
    user_id [ref: > users.id]
}

Table reviews {
    id integer [pk]
    user_id [ref: > users.id]
}

Table users_extension {
  id [ref: - users.id]
  some_field varchar
}

Thank you for your suggestions.

This has been noted and will be discussed and considered in the future.

Thanks.

1 Like