Open Thermatix opened 3 months ago
I think the straight forward way to do this is using database triggers (I'm most familiar with Postgres - less sure about others).
Right now ormlite doesn't include this, but I'd welcome any PRs to support it, and happy to answer any questions you encounter working on it.
How do I manage this manually?
So I have a User model, and an Access model, I want to trigger the creation of an Access model at the same time (with some reasonable defaults) as it's owning user model get's created.
like
The reason I suggest a separate
on_create
&Create
is because maybe you want to do something else, maybeDelete
orTrigger
a function or something.Only thing I'm not sure about are fields that have no defaults, perhaps just flat-out don't allow models like that to be auto-created