Hello,
I tried to embed a struct that contained a foreign key, but instead a getting a foreign key, the model got a jsonb field. For example, this code would trigger this problem :
type SoftDeleteMixin struct {
Deleted bool
DeletedAt *time.Time
DeletedBy *User `fk:"user_id,inverse"`
}
type Subject struct {
kallax.Model `table:"subjects" pk:"id"`
kallax.Timestamps
SoftDeleteMixin
[...]
}
Which results in this code being generated:
CREATE TABLE subjects (
created_at timestamptz NOT NULL,
updated_at timestamptz NOT NULL,
deleted boolean NOT NULL,
deleted_at timestamptz,
deleted_by jsonb
);
Do you have an idea of what's happening here ?
Thank you,
Benjamin
Hello,
I tried to embed a struct that contained a foreign key, but instead a getting a foreign key, the model got a
jsonbfield. For example, this code would trigger this problem :Which results in this code being generated:
Do you have an idea of what's happening here ?
Thank you,
Benjamin