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

More support for ALTER TABLE operations #24

Open
svoynow opened this issue Apr 24, 2014 · 5 comments
Open

More support for ALTER TABLE operations #24

svoynow opened this issue Apr 24, 2014 · 5 comments

Comments

@svoynow
Copy link
Contributor

svoynow commented Apr 24, 2014

i.e. the ability to change the datatype of a row
ALTER TABLE mytable ALTER somecolumn TYPE uuid
Just a matter of adding some methods to ColumnOperations

I'll probably do it and send a PR at some point.

@hsgubert
Copy link
Owner

@svoynow-lz , do you know if Cassandra is currently supporting this operation?

I ask you because I remember some incongruencies between Cassandra docs and what is really implemented, so you really have to test the operation to see if it works.

@svoynow
Copy link
Contributor Author

svoynow commented Apr 25, 2014

I believe it supports it in the case(s) where the data types are compatible / convertible.
So perhaps that would not be all that useful.
On further reflection, what would be useful would be being able to add table properties either in the create table operation and/or as a separate operation.

@hsgubert
Copy link
Owner

Right. So it is useful! I also agree with you second thought...

@juanlizarazo
Copy link

What about renaming column?

I was checking lib/cassandra_migrations/migration/column_operations.rb and rename_column isn't defined.

@juanlizarazo
Copy link

Never mind, just realized this would only work for primary_key names (which is the main purpose of RENAME in CQL) and it would return the "cannot rename non PRIMARY KEY part ...)" QueryError when used with non primary key column keys. That explains why it probably hasn't been implemented.

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

No branches or pull requests

3 participants