hsgubert / cassandra_migrations

Cassandra Migrations is a Cassandra database schema migration library for Rails applications.
MIT License
45 stars 43 forks source link

Remove Column ins't working. #11

Closed cristovao-trevisan closed 11 years ago

cristovao-trevisan commented 11 years ago

I think that in line 41 of column_operations.rb should be 'ALTER COLUMNFAMILY', not 'ALTER TABLE'.

hsgubert commented 11 years ago

Posting the stacktrace.. don't know yet why CQL 3 does not accept this syntax:

ALTER TABLE measurements DROP processed
rake aborted!
line 1:25 no viable alternative at input 'DROP'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/client.rb:248:in `interpret_response!'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/client.rb:241:in `block in execute_request'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/future.rb:159:in `call'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/future.rb:159:in `block in map'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/future.rb:61:in `call'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/future.rb:61:in `block (2 levels) in complete!'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/future.rb:60:in `each'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/future.rb:60:in `block in complete!'
<internal:prelude>:10:in `synchronize'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/future.rb:57:in `complete!'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/io/node_connection.rb:82:in `handle_read'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/io/io_reactor.rb:122:in `each'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/io/io_reactor.rb:122:in `io_loop'
/home/henrique/.rvm/gems/ruby-1.9.3-p286@lme_smartgrid/gems/cql-rb-1.0.0.pre7/lib/cql/io/io_reactor.rb:47:in `block (2 levels) in start'
Tasks: TOP => cassandra:migrate
(See full trace by running task with --trace)
hsgubert commented 11 years ago

From cassandra documentation:

This feature is not ready in Cassandra 1.2 but will be available in a subsequent version. To drop a column from the table, use ALTER TABLE and the DROP keyword. Dropping a column removes the column from current rows.