1
私はチャットバックエンドを作成しており、2人のユーザーを含むメッセージ履歴テーブルが必要です。1つのエンティティに2つの同じ親があります
これは正しい方法ですか?
static func prepare(_ database: Database) throws {
try database.create("historys") { history in
history.id()
history.parent(User.self, optional: false)
history.parent(User.self, optional: false)
}
}
ここで、複数のuser_idフィールドのエラーが表示されます。