in lib/aws-record/record/table_config.rb [211:258]
def migrate!
_validate_required_configuration
begin
resp = @client.describe_table(table_name: @model_class.table_name)
if _compatible_check(resp)
nil
else
unless _throughput_equal(resp)
@client.update_table(_update_throughput_opts(resp))
@client.wait_until(
:table_exists,
table_name: @model_class.table_name
)
end
unless _gsi_superset(resp)
@client.update_table(_update_index_opts(resp))
@client.wait_until(
:table_exists,
table_name: @model_class.table_name
)
end
end
rescue DynamoDB::Errors::ResourceNotFoundException
@client.create_table(_create_table_opts)
@client.wait_until(:table_exists, table_name: @model_class.table_name)
end
return unless @ttl_attribute
return if _ttl_compatibility_check
client.update_time_to_live(
table_name: @model_class.table_name,
time_to_live_specification: {
enabled: true,
attribute_name: @ttl_attribute
}
)
end