[英]Is there is any support for Single Table Inheritance in Prisma?
I have one project in Rails where I used Single Table Inheritance on Users Table, by creating two roles for Users table - 1.Clinician and 2.Patient.我在 Rails 中有一个项目,我在用户表上使用单表 Inheritance,为用户表创建两个角色 - 1.Clinician 和 2.Patient。 The model desc.
model 描述。 is below
在下面
class Patient < User has_many:clinician_patients has_many:clinicians, through: :clinician_patients end class 患者 < 用户 has_many:clinician_patients has_many:clinicians, through: :clinician_patients end
class Clinician < User has_many:clinician_patients has_many:patients, through: :clinician_patients end class 临床医生 < 用户 has_many:clinician_patients has_many:patients, through: :clinician_patients end
Here I have another table clinician_patients:-在这里,我有另一个表临床医生_患者:-
class ClinicianPatient < ActiveRecord::Base belongs_to:clinician belongs_to:patient end class ClinicianPatient < ActiveRecord::Base belongs_to:clinician belongs_to:patient end
I am new to Prisma and I want to use STI and relationships like Rails in Node using Prisma.我是 Prisma 的新手,我想使用 STI 和使用 Prisma 的 Node 中的 Rails 等关系。 How should I use STI in prisma models?
我应该如何在棱镜模型中使用 STI?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.