-
Notifications
You must be signed in to change notification settings - Fork 38
Add the ability to insert deferrable constraints after the table body #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add the ability to insert deferrable constraints after the table body #57
Conversation
@@ -128,17 +128,29 @@ def clean_options | |||
dump.gsub!(/^(INSERT INTO schema_migrations .*)\n\n/, "\\1\n") | |||
end | |||
|
|||
if options[:indexes_after_tables] == true | |||
# Extract indexes, remove comments and place them just after the respective tables | |||
if options[:meta_tables_after_main] == true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For backwards comparability it would be better to check both the new and old setting:
if options[:indexes_after_tables] || options[:meta_tables_after_main]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlinsley done
70a9507
to
041591a
Compare
041591a
to
e5d7621
Compare
@@ -128,17 +128,29 @@ def clean_options | |||
dump.gsub!(/^(INSERT INTO schema_migrations .*)\n\n/, "\\1\n") | |||
end | |||
|
|||
if options[:indexes_after_tables] == true | |||
# Extract indexes, remove comments and place them just after the respective tables | |||
if options[:indexes_after_tables] || options[:meta_tables_after_main] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to leave a comment to indicate options[:indexes_after_tables]
is the old option and is deprecated, and maybe specify a version where it will be removed? We could also add the deprecation announcement into the release notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andyatkinson like so?
Guys, at least one type of constraint can be placed after the table definition, just like indexes. It also improves the readability of the schema.