区别在于外键,一对一关联的例子是一个 User 模型关联一个 Phone 模型,反映到表结构中即
User
Phone
我(User)拥有(hasOne)一个它(Phone),我(Phone)属于(belongsTo)它(User)。