dynamodb-migration 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23f129e7e6512162694ffb46d34cffdb18f94031
4
- data.tar.gz: 4ed41c73f93839364132fe4925d8bbbe6694977f
3
+ metadata.gz: 2478734959ef5aec175bc62922f607c97c833576
4
+ data.tar.gz: 25efb74449802b0dbc2399d6b82063ca7099c8bd
5
5
  SHA512:
6
- metadata.gz: 4bcaa52f0cc70cabf36b4489d99ed80b5ee6f4993b7e7cd27f8848b2c1e2cc239e91a69543e251a2c505f952992db52e69f7d45a69bfbc1c7882543a47345cad
7
- data.tar.gz: 680954fd87736f96ca00b522af60bf89fcd04b9743a6849b1e07c48941cbb9503fa31580837ae97e2b714fcd20ff1e1d93999d76095ba4e8da522f906006cb8d
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 migration_executed?(clazz)
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 migration_executed?(clazz)
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
@@ -1,5 +1,5 @@
1
1
  module DynamoDB
2
2
  module Migration
3
- VERSION = "0.5.0"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
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.5.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-06-05 00:00:00.000000000 Z
11
+ date: 2016-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk