Skip to content
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

Add SchemaStatementsMethods #14

Merged
merged 2 commits into from
Mar 8, 2022
Merged

Conversation

Bhacaz
Copy link
Collaborator

@Bhacaz Bhacaz commented Mar 8, 2022

Fix #8

@Bhacaz Bhacaz force-pushed the add_migration_schema_connection_methods branch 2 times, most recently from b7aee69 to 7de661a Compare March 8, 2022 00:49
@Bhacaz Bhacaz force-pushed the add_migration_schema_connection_methods branch from 7de661a to 74c45d2 Compare March 8, 2022 00:50
@Bhacaz Bhacaz requested review from a team, byellokore and faridanoosheh and removed request for a team March 8, 2022 13:07
Copy link

@byellokore byellokore left a comment

Choose a reason for hiding this comment

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

ça marche aussi pour le index_exists?.


ApplicationRecord.connection.table_exists? 'SELECT COUNT(*) FROM `users`'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use already defined methods. Remove `ActiveRecord::Base.connection`.
RUBY

Choose a reason for hiding this comment

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

Suggested change
RUBY
ActiveRecord::Base.connection.index_exists? 'users', :id
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use already defined methods. Remove `ActiveRecord::Base.connection`.
RUBY

@Bhacaz Bhacaz merged commit 2f6746a into main Mar 8, 2022
@Bhacaz Bhacaz deleted the add_migration_schema_connection_methods branch March 8, 2022 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migration guard clauses simplify
2 participants