primaryKey and foreignKey only number?


I wonder if primaryKey and foreignKey has to be number or can i connect two string fields in Model?

@pikitgb :slight_smile:


this topic is more about batabases field than adonis itself, please consider this:

  • a foreign key can be a int or a string for example

  • PK and FK in related tables must be the same data type

  • Choose that works for you