Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 Activerecord-Import にて validate_uniqueness: true をして堅牢に #57

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

nikukyugamer
Copy link
Owner

@nikukyugamer nikukyugamer commented Dec 5, 2023

  • on_duplicate_key_ignore: false
    • validate_uniqueness: false
      • エラー時にはDB側の制約のエラーメッセージが出て落ちる
    • validate_uniqueness: true
      • エラー時にはActiveRecord側の制約のエラーメッセージが出て落ちる
  • on_duplicate_key_ignore: true
    • validate_uniqueness: false
      • 主キーまたはUNIQUEカラムで既存のものと一致する場合は、制約エラーを出さずにそのレコードのインポートがスキップされる
    • validate_uniqueness: true
      • ActiveRecord側の制約が生きているのでレコードスキップができない(のでこれは使いどころがないのでは)

@nikukyugamer nikukyugamer self-assigned this Dec 5, 2023
@nikukyugamer nikukyugamer merged commit 83c5dc7 into main Dec 5, 2023
2 checks passed
@nikukyugamer nikukyugamer deleted the feat/add_validate-uniquness-true branch December 5, 2023 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant