Replace DB unique index with model validator
The DB unique index in packages_nuget_symbols table cannot be aware of the package's status. However, we need to only validate the uniqueness if the package is installable. So we decided to remove the DB index and do the uniqueness validation on the application level to have access to the package's status. We can tolerate a few duplicates in the table if something escaped the model validation due to some race conditional, which isn't likely to happen. Changelog: fixed
显示
- app/models/packages/nuget/symbol.rb 15 个添加, 3 个删除app/models/packages/nuget/symbol.rb
- app/services/packages/nuget/symbols/create_symbol_files_service.rb 1 个添加, 2 个删除...ces/packages/nuget/symbols/create_symbol_files_service.rb
- db/migrate/20241217093056_add_index_packages_nuget_symbols_on_lower_signature_and_filepath.rb 17 个添加, 0 个删除...packages_nuget_symbols_on_lower_signature_and_filepath.rb
- db/post_migrate/20241205142115_remove_index_packages_nuget_symbols_on_signature_and_filepath_with_pkg.rb 23 个添加, 0 个删除...kages_nuget_symbols_on_signature_and_filepath_with_pkg.rb
- db/schema_migrations/20241205142115 1 个添加, 0 个删除db/schema_migrations/20241205142115
- db/schema_migrations/20241217093056 1 个添加, 0 个删除db/schema_migrations/20241217093056
- db/structure.sql 1 个添加, 1 个删除db/structure.sql
- spec/models/packages/nuget/symbol_spec.rb 59 个添加, 7 个删除spec/models/packages/nuget/symbol_spec.rb
- spec/services/packages/nuget/symbols/create_symbol_files_service_spec.rb 0 个添加, 2 个删除...ackages/nuget/symbols/create_symbol_files_service_spec.rb
加载中
想要评论请 注册 或 登录