Open thomaswitt opened 1 week ago
Thanks for opening an issue. The error you encountered is a service side error - it looks like you are modifying the same table at the same time. I actually think you only need one migration here. t.global_secondary_index
appends to a hash before execution. Try just a single migration:
module ModelTableConfig
def self.config
Aws::Record::TableConfig.define do |t|
t.model_class User
t.billing_mode "PAY_PER_REQUEST"
t.global_secondary_index(:user_email_gsi)
t.global_secondary_index(:user_login_gsi)
end
end
end
When creating two global secondary indexes for the same model, this leads to the following error message:
It gets especially weird: When I uncomment one global_secondary_index from the user model,
rake aws_record:migrate
runs just fine (so it's not the db/table_config files). When I then Re-Insert the global_secondary_index in the user model and runrake aws_record:migrate
again, all indexes are created correctly.So the gem can't correctly handle if two global_secondary_indexes are defined in the same model and the migrations will be run after each other.
db/table_config/gsi_user_login.rb
db/table_config/user_email_gsi.rb