-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Motivation: Let's say you have a table user and a table picture, with user.picture_id referenceing picture.id in a foreign key. You want to dump table user in full, but table picture only as schema (or not at all). If you configure slimdump this way:
<table name="user" dump="full"/>
<table name="picture" dump="schema"/>
Your dump might contain a non-NULL user.picture_id and if you try to import that, you get a foreign key constraint error.
Suggestion: Allow replacing field values with NULL, e.g. like this:
<table name="user" dump="full">
<column name="picture_id" dump="replace" replacement="NULL" />
</table>
<table name="picture" dump="schema"/>
I'm not super happy with the proposed syntax, as it would prevent replacements with the literal string "NULL" (same problem with "FAKER_*" replacements, but with "FAKER_*" it is less likely you want to use the literal string as a replacement). Maybe a separate attribute for these special replacements would be better.