Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This text is broken up into two pieces. The first is the context for the fix (which I think is correct) and the second is a question because I am misunderstanding something. I also want to try to add some tests for this.
Fix
I wanted a migration that adds a
NOT NULL
constraint to an existing field. You can see the example file in the question section below. This didn't work. After a little print debugging I realized that thecolumn.nullable
meant the existing column which would retain its' nullability always. You could never remove or add it with the TOML. I am pretty sure this works for adding or removing a nullability constraint but I want to write some tests which I'll do soon!Question
The next issue I faced is given the following migration,
After
reshape migrate
, I am unable to add new rows to the schema. I am a bit out of my element here and still learning, but I tried the following,which yields,
I am a bit confused here. Am I supposed to only insert data into the public schema and let the triggers handle everything else?
How does this work with
SET search_path TO migration_5_make_name_not_null
? Maybe I need to read more postgresql documentation here and I shouldn't be asking you?