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

Refactor SchemaCreation#visit_AddColumn #17798

Merged
merged 1 commit into from
Nov 28, 2014

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Nov 27, 2014

No description provided.

@arthurnn
Copy link
Member

Can you explain further why the code you deleted is not necessary?

@@ -4,12 +4,6 @@ module PostgreSQL
class SchemaCreation < AbstractAdapter::SchemaCreation
private

def visit_AddColumn(o)
sql_type = type_to_sql(o.type, o.limit, o.precision, o.scale)
sql = "ADD COLUMN #{quote_column_name(o.name)} #{sql_type}"
Copy link
Member Author

Choose a reason for hiding this comment

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

The difference between the parent class visit_AddColumn only if "ADD " or "ADD COLUMN ".
However, "COLUMN" can be omitted.
http://www.postgresql.org/docs/9.3/static/sql-altertable.html

senny added a commit that referenced this pull request Nov 28, 2014
Refactor `SchemaCreation#visit_AddColumn`
@senny senny merged commit f2d602b into rails:master Nov 28, 2014
@senny
Copy link
Member

senny commented Nov 28, 2014

thank you 💛

@kamipo kamipo deleted the refactor_visit_add_column branch December 18, 2014 03:05
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.

None yet

3 participants