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

change_table transformations #7788

Closed
judearasu opened this issue Sep 29, 2012 · 5 comments
Closed

change_table transformations #7788

judearasu opened this issue Sep 29, 2012 · 5 comments
Labels

Comments

@judearasu
Copy link
Contributor

Is it fine to write the change_table transformation on

https://github.com/rails/rails/blob/master/activerecord/lib/active_record/migration.rb

As it is not available on the migration file

change_table(:suppliers) do |t|
t.column :name, :string, :limit => 60

Other column alterations here

end

@bobbywilson0
Copy link
Contributor

It's not clear what you are asking. Can you please describe the issue in more detail or close it?

@judearasu
Copy link
Contributor Author

@Bobbyw In activerecord/lib/active_record/migration.rb file create_table, drop_table & rename_table has been documented, is it fair enough to document change_table on transformations list or not ?

#create_table(name, options) Creates a table called +name+ and
#makes the table object available to a block that can then add columns to it,
#following the same format as add_column. See example above. The options hash
#is for fragments like "DEFAULT CHARSET=UTF-8" that are appended to the create
#table definition.
#
drop_table(name): Drops the table called +name+.
#* rename_table(old_name, new_name): Renames the table called +old_name+

to +new_name+.

@bobbywilson0
Copy link
Contributor

Ah I see what you are saying now. change_table is defined here http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-change_table So I don't know if it makes the most sense to document it in migrations, although I understand it is relevant, and the provided documentation on change_table is pretty slim.

Someone more involved than myself would be better to make this decision. @steveklabnik is a nice guy and might be able to provide some insight.

@frodsan
Copy link
Contributor

frodsan commented Sep 30, 2012

@rafaelfranca
Copy link
Member

I think so. CLosing this one. Thanks @frodsan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants