Moaaz
11/14/2021, 3:03 AM@@index
Writing a plugin that does versioning to store history of changes on a data model – for each Datamodel
, would like to define a DatamodelVersion
model which specifies some fields for storing history and some references to Datamodel
In addition would like to add versions: DatamodelVersion
to the original Datamodel
schema. But in doing so, losing any @@index
that is defined on the original Datamodel
schema.Jason Abbott
11/14/2021, 4:12 AMMoaaz
11/14/2021, 10:48 PMJason Abbott
11/15/2021, 12:40 AMparseSqlTypes()
and get back an object that has the db type (like Varchar(25)
) mapped to fields within models, same as the DMMF.
That way, when iterating fields in the DMMF, it's a simple, direct lookup to get the db types. Using the regular generator SDK (which you may not be doing), I make the parse call at the top of onGenerate
and pass the result through along side the SDK-provided DMMF.Moaaz
11/15/2021, 4:09 PMRyan
11/16/2021, 5:40 AMMoaaz
11/16/2021, 7:37 PMRyan
11/17/2021, 9:01 AM