Skip to content

Commit

Permalink
Fix some CF bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mwynholds committed Jan 26, 2011
1 parent 7d64ed4 commit eeac9a4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
8 changes: 1 addition & 7 deletions .rvmrc
@@ -1,7 +1 @@

if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
&& -s "${rvm_path:-$HOME/.rvm}/environments/ruby-1.9.2-p0@active_column" ]] ; then
\. "${rvm_path:-$HOME/.rvm}/environments/ruby-1.9.2-p0@active_column"
else
rvm --create "ruby-1.9.2-p0@active_column"
fi
rvm --create 1.9.2@active_column
7 changes: 2 additions & 5 deletions Gemfile.lock
Expand Up @@ -56,7 +56,7 @@ GEM
file-tail (1.0.5)
spruz (>= 0.1.0)
i18n (0.5.0)
json (1.4.6)
json (1.5.0)
mail (2.2.12)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
Expand Down Expand Up @@ -105,7 +105,7 @@ GEM
ruby_parser (2.0.5)
sexp_processor (~> 3.0)
sexp_processor (3.0.5)
simple_uuid (0.1.1)
simple_uuid (0.1.2)
sourcify (0.4.0)
ruby2ruby (>= 1.2.5)
sexp_processor (>= 3.0.5)
Expand Down Expand Up @@ -133,12 +133,9 @@ PLATFORMS

DEPENDENCIES
active_column!
activesupport
bluecloth
cassandra (>= 0.9)
mocha
rails (>= 3.0)
rake
rspec-rails
wrong
yard
8 changes: 5 additions & 3 deletions lib/active_column/migrator.rb
Expand Up @@ -98,11 +98,13 @@ def self.move(direction, migrations_path, steps)
public

def initialize(direction, migrations_path, target_version = nil)
cf = ActiveColumn.column_family_tasks
cf_tasks = ActiveColumn.column_family_tasks
sm_cf = self.class.schema_migrations_column_family

unless cf.exists?(sm_cf)
cf.create(sm_cf, :comparator_type => 'LongType')
unless cf_tasks.exists?(sm_cf)
cf_tasks.create(sm_cf) do |cf|
cf.comparator_type = 'LongType'
end
end

@direction, @migrations_path, @target_version = direction, migrations_path, target_version
Expand Down
11 changes: 6 additions & 5 deletions spec/spec_helper.rb
Expand Up @@ -12,17 +12,18 @@

$cassandra = ActiveColumn.connection = Cassandra.new('active_column', '127.0.0.1:9160')

keyspace = 'active_column'
ks_tasks = ActiveColumn.keyspace_tasks
unless ks_tasks.exists?('active_column')
ks_tasks.create('active_column')
unless ks_tasks.exists?(keyspace)
ks_tasks.create keyspace

cf_tasks = ActiveColumn.column_family_tasks
cf_tasks = ActiveColumn.column_family_tasks keyspace
[:tweets, :tweet_dms].each do |cf|
cf_tasks.create(cf, :keyspace => 'active_column')
cf_tasks.create cf
end
end

ks_tasks.set 'active_column'
ks_tasks.set keyspace
ks_tasks.clear

RSpec.configure do |config|
Expand Down

0 comments on commit eeac9a4

Please sign in to comment.