Open dimitri-yatsenko opened 7 years ago
@dimitri-yatsenko should parts be allowed to not reference master?
Also, if so, this issue can probably be closed based on review of merge history ^^.
Hi @dimitri-yatsenko I noticed that there used to be an argument for force=True
when dropping a part table, that #957 deprecated. It seems like this issue is for part tables that don't reference their parent table and I was wondering how you may handle a situation where the part table is dependent on an upstream table, but the parent is not.
Say you have a part table, foo.part
, that does reference its parent table, foo
, and is also dependent on an upstream table, upfoo
, but foo
is not, is there a way to drop foo.part
without affecting foo
or other part tables (foo.part2
, foo.part3
, etc…) attached to foo
that aren’t dependent on upfoo
? Thanks!
@dpeg22 We intentionally removed the force=True
argument in datajoint 0.13.3
, I am currently evaluating whether we should reintroduce this. @dimitri-yatsenko Do you have any input on this?
If an example may help, the PosSource
table here has two part tables (PosSource.DLCPos
and PosSource.TrodesPos
) that depend on PosSource
and an upstream table (DLCPos
, TrodesPos
), which PosSource
itself does not depend on.
Let me think and answer carefully.
@dimitri-yatsenko I was wondering if there is an update on this?
In the current version, user_tables.Part.drop
has a force
arg here to circumvent an error regarding dropping a part w/o dropping the master. If set to True
, the user encounters a similar error here. These errors seem to be redundant. Is the aim to prevent this drop even if force=True
? The drop can be achieved with drop_quick
, so perhaps force=True
should result in super().drop_quick()
?
This is a rare problem but it can occur.
If a part table does not reference its master, then dropping the master will result in part tables with no master. DataJoint does not know how to handle this situation and throws an error like this:
Although it's unusual to create part tables that don't reference their masters, it is possible and this needs to be fixed.
I propose the following fix: Dropping a master table should result in dropping of all its parts regardless of whether they make a foreign key reference to the master or not.