You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
#[derive(Model)]#[ormlite(on_create(Create(Foo, foo)))]// some way to indicate model and join field#[ormlite(on_delete(Delete(Foo, foo)))]pubstructFoo{#[ormlite(primary_key)]pubid:ID,}#[derive(Model)]pubstructBar{#[ormlite(primary_key)]pubid:ID,#[ormlite(join_column = "foo_id")]pubfoo:Join<Foo>,}
The reason I suggest a separate on_create & Create is because maybe you want to do something else, maybe Delete or Trigger 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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: