dynamodb-migration 0.6.0 → 0.7.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: 2478734959ef5aec175bc62922f607c97c833576
4
- data.tar.gz: 25efb74449802b0dbc2399d6b82063ca7099c8bd
3
+ metadata.gz: 7438e7d0407f14c9802d739098fcf93a2d87292e
4
+ data.tar.gz: 49b54b9232e0026d4227eeeeeb910a48a7cbcb7e
5
5
  SHA512:
6
- metadata.gz: 05b38eb947e6bd74bb7c93410761278f50b71c9ea24daec1a48e5007a4999412318cbff26056ca939d50c17541556db46c1638c08a0bd9bdef30eae72f2317b1
7
- data.tar.gz: 3cf4fcfee7051eb1c754cf08a94de98ca735507c5ad2c5f30986f95bcb2810685cf1fd33948579ce90a03936d62484308e2e501f7ecf12e35fd80f30ecf70850
6
+ metadata.gz: 8666ea2fd78aa07d723c8c7d12cabfa90fe36df0455a980bfa17cc0c4326ebcd003752d9535fd0c40116ae1d73f120630b64b123846de02be764a5700083d1e7
7
+ data.tar.gz: 527c0cf47f522a38caf0948e178a53f34c49d2eba0d627a084930331def7d3a80ab12bbd5f771be51bfb194c57360ad5bffe686520ccf5d04fa88f56eafdf381
data/README.md CHANGED
@@ -31,7 +31,7 @@ require 'dynamodb/migration'
31
31
 
32
32
  options = {
33
33
  client: dynamodb_client, # an Aws::DynamoDB::Client instance
34
- path: '/app/my_project/migrations' # the full path to the folder where your migration classes will live
34
+ path: '/app/my_project/migrations', # the full path to the folder where your migration classes will live
35
35
  migration_table_name: 'migrations' # optional, the name of the table to use for migrations, default is "migrations"
36
36
  }
37
37
  DynamoDB::Migration.run_all_migrations(options)
@@ -103,29 +103,34 @@ module DynamoDB
103
103
  end
104
104
 
105
105
  def ensure_migrations_table_exists
106
- client.create_table(
107
- table_name: migration_table_name,
108
- attribute_definitions: [
109
- {
110
- attribute_name: "file",
111
- attribute_type: "S",
106
+ unless table_exists?(client, migration_table_name)
107
+ client.create_table(
108
+ table_name: migration_table_name,
109
+ attribute_definitions: [
110
+ {
111
+ attribute_name: "file",
112
+ attribute_type: "S",
113
+ },
114
+ ],
115
+ key_schema: [
116
+ {
117
+ attribute_name: "file",
118
+ key_type: "HASH",
119
+ },
120
+ ],
121
+ provisioned_throughput: {
122
+ read_capacity_units: 1,
123
+ write_capacity_units: 1,
112
124
  },
113
- ],
114
- key_schema: [
115
- {
116
- attribute_name: "file",
117
- key_type: "HASH",
125
+ stream_specification: {
126
+ stream_enabled: true,
127
+ stream_view_type: "NEW_AND_OLD_IMAGES",
118
128
  },
119
- ],
120
- provisioned_throughput: {
121
- read_capacity_units: 1,
122
- write_capacity_units: 1,
123
- },
124
- stream_specification: {
125
- stream_enabled: true,
126
- stream_view_type: "NEW_AND_OLD_IMAGES",
127
- },
128
- ) unless table_exists?(client, migration_table_name)
129
+ )
130
+ puts "Waiting for table #{migration_table_name} to exist..."
131
+ client.wait_until(:table_exists, {:table_name => migration_table_name})
132
+ puts "#{migration_table_name} exists, continuing migration."
133
+ end
129
134
  rescue Aws::DynamoDB::Errors::ResourceInUseException => e
130
135
  raise e unless e.message =~ /preexisting table/i
131
136
  end
@@ -1,5 +1,5 @@
1
1
  module DynamoDB
2
2
  module Migration
3
- VERSION = "0.6.0"
3
+ VERSION = "0.7.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.6.0
4
+ version: 0.7.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-12 00:00:00.000000000 Z
11
+ date: 2017-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk