dynamodb-migration 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dynamodb/migration/execute.rb +7 -4
- data/lib/dynamodb/migration/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2478734959ef5aec175bc62922f607c97c833576
|
4
|
+
data.tar.gz: 25efb74449802b0dbc2399d6b82063ca7099c8bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05b38eb947e6bd74bb7c93410761278f50b71c9ea24daec1a48e5007a4999412318cbff26056ca939d50c17541556db46c1638c08a0bd9bdef30eae72f2317b1
|
7
|
+
data.tar.gz: 3cf4fcfee7051eb1c754cf08a94de98ca735507c5ad2c5f30986f95bcb2810685cf1fd33948579ce90a03936d62484308e2e501f7ecf12e35fd80f30ecf70850
|
@@ -20,7 +20,7 @@ module DynamoDB
|
|
20
20
|
attr_reader :client
|
21
21
|
|
22
22
|
def apply_migration(clazz)
|
23
|
-
return if
|
23
|
+
return if migration_completed?(clazz)
|
24
24
|
record_start_migration(clazz)
|
25
25
|
migration = clazz.new
|
26
26
|
migration.client = client
|
@@ -86,17 +86,20 @@ module DynamoDB
|
|
86
86
|
def migration_classes
|
87
87
|
ObjectSpace.each_object(DynamoDB::Migration::Unit.singleton_class)
|
88
88
|
.reject { |c| c == DynamoDB::Migration::Unit }
|
89
|
+
.sort_by { |c| clazz_filename(c) }
|
89
90
|
end
|
90
91
|
|
91
|
-
def
|
92
|
-
client.get_item({
|
92
|
+
def migration_completed?(clazz)
|
93
|
+
migration = client.get_item({
|
93
94
|
table_name: migration_table_name,
|
94
95
|
key: {
|
95
96
|
"file" => clazz_filename(clazz),
|
96
97
|
},
|
97
|
-
attributes_to_get: ["file"],
|
98
|
+
attributes_to_get: ["file", "completed"],
|
98
99
|
consistent_read: true,
|
99
100
|
}).item
|
101
|
+
|
102
|
+
migration && migration["completed"]
|
100
103
|
end
|
101
104
|
|
102
105
|
def ensure_migrations_table_exists
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamodb-migration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Lawson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|