user15748180
user15748180

Reputation: 41

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. The model desc. is below

class Patient < User 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

Here I have another table clinician_patients :-

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. How should I use STI in prisma models?

Upvotes: 4

Views: 6193

Answers (1)

Johannes Klau&#223;
Johannes Klau&#223;

Reputation: 11020

As you can see here prisma does not support table inheritance yet, but support is planned in the future.

There are some shim implementations you can try out until there is an official implementation:

Upvotes: 3

Related Questions