dynamodb-migration 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/dynamodb/migration/execute.rb +26 -21
- 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: 7438e7d0407f14c9802d739098fcf93a2d87292e
|
4
|
+
data.tar.gz: 49b54b9232e0026d4227eeeeeb910a48a7cbcb7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
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
|
-
|
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
|
-
|
121
|
-
|
122
|
-
|
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
|
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.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:
|
11
|
+
date: 2017-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|