Closed paupino closed 6 years ago
So, the delta
represents the diff of 2 states, publish_profile
is the options used to generate it.
delta
was a separate file because it's used for all the operations (script
is generating a delta and then turning that into SQL, report
is generating the delta and rendering that as a report etc)
Not sure the 2 files should be merged, but not super against it either.
Yeah, I see your point re breaking out delta.rs
. Perhaps the logical separation then is:
In terms of publish profiles - since they define delta generation they could be kept in the same file? I actually made this all part of a separate commit so it's easy to roll back if need be :)
@justinlatimer I reverted back to keeping the files separate. We can have a chat about the strategy we want to take over slack later on.
This is the start of the column modification logic.
I suspect we'll want to add further validation rules about what can and cannot be changed somewhere. Validation rules returned from
generate
could be an interesting extension. I'm thinking it could return a vector of "Violations" which the publish profile could then "filter" before potentially erroring out if more exist. This is more for things like changing abinary
type to anint
or something stupid.This PR ignores changing table constraints at a column level at the moment, e.g. adding
UNIQUE
or removingUNIQUE
at a column level. These are anonymous table level constraints so we'll need to likely extend the AST to support these types as well as loop through them as part of #30.One other change in this PR is the merging of
delta.rs
andprofiles.rs
into a singlepublish.rs
. I've been struggling remembering what each file is responsible for; this is perhaps a step towards association each file with the operation it's closely tied to.Anyway, keen to hear your thoughts on