Skip to content

SQLite3 adapter alter_table method restores foreign keys#33585

Merged
kamipo merged 1 commit intorails:masterfrom
yahonda:diag33520
Aug 16, 2018
Merged

SQLite3 adapter alter_table method restores foreign keys#33585
kamipo merged 1 commit intorails:masterfrom
yahonda:diag33520

Conversation

@yahonda
Copy link
Member

@yahonda yahonda commented Aug 11, 2018

Summary

SQLite3 adapter alter_table method restores foreign keys.

Rails 6 supports SQLite database 3.8 or higher which allows executing alter_table method for foreign key referenced - "parent" tables. This pull request enables alter_table method for foreign keys referencing - "child" tables.

Related to #33520, this pull request does not support renaming columns for foreign keys.

@rails-bot
Copy link

r? @georgeclaghorn

(@rails-bot has picked a reviewer for you, use r? to override)

Copy link
Member

@eileencodes eileencodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Can you add a change log entry?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a space before and after this block? Like this:

end

if options[:foreign_keys]
 ...
end

yield

@eileencodes eileencodes added this to the 6.0.0 milestone Aug 11, 2018
@yahonda
Copy link
Member Author

yahonda commented Aug 11, 2018

Thanks for the review. Added a new changelog entry and made changes as suggested.

@georgeclaghorn
Copy link
Contributor

r? @eileencodes

@kamipo kamipo merged commit 33ce73e into rails:master Aug 16, 2018
kamipo added a commit that referenced this pull request Aug 16, 2018
SQLite3 adapter `alter_table` method restores foreign keys
@yahonda yahonda deleted the diag33520 branch August 16, 2018 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants