cassandra_migrations 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cassandra_migrations/cassandra/keyspace_operations.rb +1 -0
- data/lib/cassandra_migrations/errors.rb +6 -0
- data/lib/cassandra_migrations/migration/table_definition.rb +4 -0
- data/lib/cassandra_migrations/migrator.rb +8 -3
- data/lib/cassandra_migrations/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a28e40a6fe9323547d4484bdfb6ace0bf2dee21c
|
4
|
+
data.tar.gz: 7a2215ba07262a12038b7bf5cd7c6ac4582db4a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d795b210e5eefd853eb25ba8b3d8bfce1955aa1645e751e6a98cc995cdc96b6f7be46367ddec6263ed29fb2a94bb55634adf68ffcb49b643bddbad8e2a4ed3e
|
7
|
+
data.tar.gz: e602f7cec7715b2d7bc16bdd5390cb1b75fa269d09bd038b0f0ff562a7bb71898e8ab1d273df4cbdc6e56fcf8591dc5436ceb1a4679d33f2104806c7d1254c63
|
@@ -247,6 +247,10 @@ module CassandraMigrations
|
|
247
247
|
when :compact_storage
|
248
248
|
cql_name
|
249
249
|
else
|
250
|
+
#if complex option with nested hash, convert keys and values to proper string value
|
251
|
+
if value.is_a?(Hash)
|
252
|
+
value = "{#{value.map {|k, v| "'#{k}':'#{v}'"}.join(',')}}"
|
253
|
+
end
|
250
254
|
"#{cql_name} = #{value}"
|
251
255
|
end
|
252
256
|
end
|
@@ -81,11 +81,16 @@ private
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def self.get_class_from_migration_name(filename)
|
84
|
-
filename.match(/[0-9]
|
84
|
+
migration_name = filename.match(/[0-9]+_(.+)\.rb$/).captures.first.camelize
|
85
|
+
migration_name.constantize
|
86
|
+
rescue NameError => e
|
87
|
+
raise Errors::MigrationNamingError, "Migration file names must match the class name in the migration—could not find class #{migration_name}."
|
85
88
|
end
|
86
89
|
|
87
|
-
def self.get_version_from_migration_name(
|
88
|
-
|
90
|
+
def self.get_version_from_migration_name(filename)
|
91
|
+
filename.match(/\/([0-9]+)_.+\.rb$/).captures.first.to_i
|
92
|
+
rescue
|
93
|
+
raise Errors::MigrationNamingError, "Migration file names must start with a numeric version prefix."
|
89
94
|
end
|
90
95
|
end
|
91
96
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cassandra_migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique Gubert
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cassandra-driver
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '3.0'
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 2.1.1
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - "~>"
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: '
|
30
|
+
version: '3.0'
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.1.1
|
@@ -49,14 +49,14 @@ dependencies:
|
|
49
49
|
name: rails
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.2'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '3.2'
|
62
62
|
- !ruby/object:Gem::Dependency
|