Open nelsonrogers opened 1 year ago
Hi @nelsonrogers thanks for filing this issue! We'll keep this open for tracking and use it to update any progress.
A few follow-ups about your scenario:
order_status
table?order_status
rows as well?I think if order_status
is just a reference table (that you do not want to synthesize), there may be other options we can look into such as denormalization.
I am facing the "constraints across multiple tables" problem as well but with a different scenario.
Say you have a table called task
,
and child table called sub_task
,
for each task, it may have one or multiple sub tasks.
Say both task
and sub_task
table contains column is_finish
, the possible values are 1
and 0
,
and is_finish
in task
cannot be 1
if it's any sub task is not finished.
I am facing the "constraints across multiple tables" problem as well but with a different scenario.
Say you have a table called
task
, and child table calledsub_task
, for each task, it may have one or multiple sub tasks.Say both
task
andsub_task
table contains columnis_finish
, the possible values are1
and0
, andis_finish
intask
cannot be1
if it's any sub task is not finished.
I have a similar problem! Hope this feature will be added shortly
I'm sorry for not replying earlier, I must have missed the email.
It doesn't have other columns in this case as it was just my testimony data, but in other similar cases, I have come across the same issue.
I do not want to create a new table. To avoid recreating a different table, I have been using Unique as a workaround
It would be cool to be able to set constraints taking values in different tables
Say you have an
orders
table with astatus
field and adelivery_date
. Say thestatus
field containsorder_status_id
from anorder_status
table.Imagine the
order_status
table as follows: 1 : Processed 2 : Shipped 3 : DeliveredIf the order has not yet been delivered, the status field should show
1
or2
.In this situation, it would be good to have a constraint like a
FixedCombination
that would check that when adelivery_date
exists, the foreign key in thestatus
field corresponds toDelivered
in theorder_status
table.