primaryKey and foreignKey only number?


#1

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

@pikitgb :slight_smile:


#2

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