cassie 1.1.0.pre2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16ae8e8e9728e84b78a102b1a42937d89ee9249f
4
- data.tar.gz: 72e87ae44eab6a96c566af3c1835beaa35c194f3
3
+ metadata.gz: c69c7faad6e465a92ab097dc7df5a471585694e1
4
+ data.tar.gz: cb03bcbb2b28029fd977d9709085b741e6606d60
5
5
  SHA512:
6
- metadata.gz: 994a3b26d1093f06a7004d74f75936e77a56fd34eba323891b6e5e6637a620fcd26bb50bfb128b1cd9e24fea61603b82d391a101b54118203ae4a47883034420
7
- data.tar.gz: c4fa532a24ad9b1c9149c03394e66bc6e1fc1ef1738f57a6d43e6d13ebad5741e046bb4ebd197a5d81cbe8ce2090a16e4a23c084ff8481e03b779ac7af3abc52
6
+ metadata.gz: 4d120d17ebd793fcb0ff7c3387fc3b1b10e6eaaf1003dab3b4b579414582cc47397ffde20c5f2b7fef689e02005f21a528abbe7cf0706f12faf819f60dfc38ac
7
+ data.tar.gz: 6f09e37b7e431609c0a8184d494e12a2f9b2e6c39e9f8955149d65653fe2014327204963cae78d55dff83ab8b966484a14ce2bced676c59bac8b0c63d73ab146
@@ -48,7 +48,7 @@ cassie migrations:import
48
48
  ```bash
49
49
  -- Initializing Cassie Versioning
50
50
  -- done
51
- -- Initializing 'cassie_development' Keyspace
51
+ -- Initializing 'my_app_development' Keyspace
52
52
  -- done
53
53
  -- Importing `cassandra_migrations` migration files
54
54
  - Importing db/cassandra_migrate/20161206214301_initial_database.rb
@@ -102,7 +102,7 @@ cassie schema:import
102
102
 
103
103
  Locally, these import tasks will also initialiaze the local version tracking to have all migration versions recorded.
104
104
 
105
- However, another developer's or environment's database does not have this schema metadata. Syncronize version tracking by initializing cassie schema with the version of the current in-database schema.
105
+ However, another developer's or environment's database does not have this schema metadata. Syncronize version tracking for these databases by initializing cassie schema with the version of the current in-database schema.
106
106
 
107
107
  ```
108
108
  cassie schema:init -v 0.0.2.0
@@ -116,7 +116,7 @@ cassie schema:init -v 0.0.2.0
116
116
  > Recorded version 0.0.1.0
117
117
  > Recorded version 0.0.2.0
118
118
  -- done
119
- -- Initializing 'cassie_development' Keyspace
119
+ -- Initializing 'my_app_development' Keyspace
120
120
  -- done
121
121
  ```
122
122
 
@@ -172,7 +172,7 @@ cassie migrate 0.2.0
172
172
 
173
173
  ##### Rolling back
174
174
 
175
- Use the same interface to migrate up or down to a specific version.
175
+ Use the same command to migrate up or down to a specific version.
176
176
 
177
177
  ```
178
178
  cassie migrate 0.1.9
@@ -184,6 +184,8 @@ cassie schema:version
184
184
  ```
185
185
  ```
186
186
  +-----------+----------------+-------------+---------------------------+
187
+ | Environment: development |
188
+ +-----------+----------------+-------------+---------------------------+
187
189
  | Version | Description | Migrated by | Migrated at |
188
190
  +-----------+----------------+-------------+---------------------------+
189
191
  | * 0.2.0.0 | create users | serverbot | 2016-09-08 10:23:54 -0500 |
@@ -196,6 +198,8 @@ cassie schema:history
196
198
  ```
197
199
  ```
198
200
  +-----------+----------------+-------------+---------------------------+
201
+ | Environment: development |
202
+ +-----------+----------------+-------------+---------------------------+
199
203
  | Version | Description | Migrated by | Migrated at |
200
204
  +-----------+----------------+-------------+---------------------------+
201
205
  | * 0.2.0.0 | create users | serverbot | 2016-09-08 10:23:54 -0500 |
@@ -212,6 +216,8 @@ cassie schema:status
212
216
  ```
213
217
  ```
214
218
  +-----------+----------------+--------+---------------------------------------------------------------+
219
+ | Environment: development |
220
+ +-----------+----------------+--------+---------------------------------------------------------------+
215
221
  | Number | Description | Status | Migration File |
216
222
  +-----------+----------------+--------+---------------------------------------------------------------+
217
223
  | 0.0.3.0 | create friends | DOWN | db/cassandra/migrations/0000_0000_0003_0000_create_friends.rb |
@@ -231,7 +237,7 @@ It is updated (with a full dump) after each migration, to maintain a truth-store
231
237
  cassie schema:dump
232
238
  ```
233
239
  ```
234
- -- Dumping Cassandra schema (version 0.2.0.0)
240
+ -- Dumping 'development' schema (version 0.2.0.0)
235
241
  - Writing to db/cassandra/schema.rb
236
242
  - done
237
243
  -- done
@@ -242,10 +248,11 @@ cassie schema:dump
242
248
  cassie schema:drop
243
249
  ```
244
250
  ```
245
- -- Dropping 2 keyspaces
251
+ -- Dropping 'development' schema
246
252
  - Dropping 'my_app_development'
247
253
  - done
248
- - Dropping 'cassie_schema'
254
+ - Clearning schema version metadata
255
+ > removed 2 versions
249
256
  - done
250
257
  -- done
251
258
  ```
@@ -255,7 +262,7 @@ cassie schema:drop
255
262
  cassie schema:load
256
263
  ```
257
264
  ```
258
- -- Loading Schema from db/cassandra/schema.rb
265
+ -- Loading 'development' schema from db/cassandra/schema.rb
259
266
  > Schema is now at version 0.2.0.0
260
267
  -- done
261
268
  ```
@@ -266,13 +273,14 @@ cassie schema:load
266
273
  cassie schema:reset
267
274
  ```
268
275
  ```
269
- -- Dropping 2 keyspaces
276
+ -- Dropping 'development' schema
270
277
  - Dropping 'my_app_development'
271
278
  - done
272
- - Dropping 'cassie_schema'
279
+ - Clearning schema version metadata
280
+ > removed 2 versions
273
281
  - done
274
282
  -- done
275
- -- Loading Schema from db/cassandra/schema.rb
283
+ -- Loading 'development' schema from db/cassandra/schema.rb
276
284
  > Schema is now at version 0.2.0.0
277
285
  -- done
278
286
  ```
@@ -285,26 +293,27 @@ This task reload the schema from the schema file, and then proceeds with increme
285
293
  cassie migrate:reset
286
294
  ```
287
295
  ```
288
- -- Dropping 2 keyspaces
289
- - Dropping 'cassie_development'
296
+ -- Dropping 'development' schema
297
+ - Dropping 'my_app_development'
290
298
  - done
291
- - Dropping 'cassie_schema'
299
+ - Clearning schema version metadata
300
+ > removed 2 versions
292
301
  - done
293
302
  -- done
294
- -- Loading Schema from db/cassandra/schema.rb
303
+ -- Loading 'development' schema from db/cassandra/schema.rb
295
304
  > Schema is now at version 0.2.0.0
296
305
  -- done
297
- -- Migrating to version 0.2.1.0
306
+ -- Migrating 'development' schema to version 0.2.1.0
298
307
  - Migragting version 0.2.1.0 UP
299
308
  - done (4.89 ms)
300
309
  -- done
301
- -- Dumping Cassandra schema (version 0.2.1.0)
310
+ -- Dumping 'development' schema (version 0.2.1.0)
302
311
  - Writing to db/cassandra/schema.rb
303
312
  - done
304
313
  -- done
305
314
  ```
306
315
 
307
- ### Multiple Envrionments
316
+ ### Managing Envrionments
308
317
 
309
318
  Set the environment with `RACK_ENV`, `CASSANDRA_ENV` or the `--env`(`-e`) switch for `cassie` commands:
310
319
 
@@ -316,6 +325,8 @@ is equivalent to
316
325
  cassie migrate:reset -e test
317
326
  ```
318
327
 
328
+ The `schema.rb` file contains keyspace-agnostic DSL. When loading the schema, its commands will be run against the default keyspace for the environment.
329
+
319
330
 
320
331
  ### Version / Migration Architecture (`cassie` developers)
321
332
 
@@ -11,7 +11,6 @@ module Cassie::Schema
11
11
 
12
12
 
13
13
  def initialize(target)
14
- puts target
15
14
  @target_version = build_target_version(target)
16
15
  @current_version = Cassie::Schema.version
17
16
  @direction = build_direction
@@ -1,6 +1,7 @@
1
1
  module Cassie::Schema
2
2
  require_relative 'queries'
3
3
 
4
+ # @deprecated Use {Cassie::Schema::SchemaDumper} instead
4
5
  class StructureDumper
5
6
  attr_reader :destination_path
6
7
 
@@ -1,24 +1,26 @@
1
1
  module Cassie::Schema
2
- class StructureLoader
3
- attr_reader :source_path
4
2
 
3
+ # @deprecated Use {Cassie::Schema::SchemaLoader} instead
4
+ class StructureLoader
5
+ attr_reader :source_path
5
6
 
6
- def initialize(opts={})
7
- @source_path = opts[:source_path] || default_source_path
8
- end
9
7
 
10
- def load
11
- args = ["-f", source_path]
12
- runner = Cassie::Support::SystemCommand.new("cqlsh", args)
8
+ def initialize(opts={})
9
+ @source_path = opts[:source_path] || default_source_path
10
+ end
13
11
 
14
- runner.run
15
- raise runner.failure_message unless runner.success?
16
- end
12
+ def load
13
+ args = ["-f", source_path]
14
+ runner = Cassie::Support::SystemCommand.new("cqlsh", args)
15
+
16
+ runner.run
17
+ raise runner.failure_message unless runner.success?
18
+ end
17
19
 
18
- protected
20
+ protected
19
21
 
20
- def default_source_path
21
- Cassie::Schema.paths[:schema_file]
22
+ def default_source_path
23
+ Cassie::Schema.paths[:schema_file]
24
+ end
22
25
  end
23
- end
24
26
  end
@@ -6,7 +6,7 @@ namespace :cassie do
6
6
 
7
7
  begin
8
8
  loader = Cassie::Schema::SchemaLoader.new
9
- puts "-- Loading '#{Cassie.env}' Schema from #{loader.source_path}"
9
+ puts "-- Loading '#{Cassie.env}' schema from #{loader.source_path}"
10
10
  loader.load
11
11
  puts " > '#{Cassie.env}' schema is now at version #{Cassie::Schema.version}"
12
12
  puts "-- done"
@@ -25,11 +25,6 @@ module Cassie
25
25
  display_info
26
26
  end
27
27
 
28
- # @returns [Boolean] if task was invoked
29
- def run_command
30
- task && task.invoke
31
- end
32
-
33
28
  # @returns [Rake::Task, nil] nil if task is not defined, otherwise the task object itself
34
29
  def task
35
30
  task_name = "cassie:#{command}"
@@ -52,6 +47,11 @@ module Cassie
52
47
 
53
48
  protected
54
49
 
50
+ # @returns [Boolean] if task was invoked
51
+ def run_command
52
+ task && task.invoke
53
+ end
54
+
55
55
  def print_documentation
56
56
  docs = <<-EOS
57
57
  Usage:
@@ -1,3 +1,3 @@
1
1
  module Cassie
2
- VERSION = "1.1.0.pre2"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.pre2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Prothro
@@ -269,9 +269,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
269
269
  version: '0'
270
270
  required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  requirements:
272
- - - ">"
272
+ - - ">="
273
273
  - !ruby/object:Gem::Version
274
- version: 1.3.1
274
+ version: '0'
275
275
  requirements: []
276
276
  rubyforge_project:
277
277
  rubygems_version: 2.5.2