20260515105302_SeedEmailTemplateDefaults.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Infrastructure.Migrations.AppDb
  4. {
  5. /// <inheritdoc />
  6. public partial class SeedEmailTemplateDefaults : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.Sql(@"
  12. UPDATE Config SET
  13. EmailTemplate_RegisterEmailFormTitle = N'회원가입 이메일 인증번호'
  14. WHERE EmailTemplate_RegisterEmailFormTitle IS NULL;
  15. UPDATE Config SET
  16. EmailTemplate_RegisterEmailFormContent = N'<p>회원가입 이메일 인증번호입니다.</p><p><strong>{Code}</strong></p><p>이 코드는 5분간 유효합니다.</p>'
  17. WHERE EmailTemplate_RegisterEmailFormContent IS NULL;
  18. UPDATE Config SET
  19. EmailTemplate_RegistrationEmailFormTitle = N'회원가입을 환영합니다'
  20. WHERE EmailTemplate_RegistrationEmailFormTitle IS NULL;
  21. UPDATE Config SET
  22. EmailTemplate_RegistrationEmailFormContent = N'<p>안녕하세요 {Nickname}님, 회원가입이 완료되었습니다.</p><p>서비스를 이용해 주셔서 감사합니다.</p>'
  23. WHERE EmailTemplate_RegistrationEmailFormContent IS NULL;
  24. UPDATE Config SET
  25. EmailTemplate_ResetPasswordEmailFormTitle = N'비밀번호 재설정 인증번호'
  26. WHERE EmailTemplate_ResetPasswordEmailFormTitle IS NULL;
  27. UPDATE Config SET
  28. EmailTemplate_ResetPasswordEmailFormContent = N'<p>비밀번호 재설정 인증번호입니다.</p><p><strong>{Code}</strong></p><p>이 코드는 10분간 유효합니다.</p>'
  29. WHERE EmailTemplate_ResetPasswordEmailFormContent IS NULL;
  30. UPDATE Config SET
  31. EmailTemplate_EmailVerifyFormTitle = N'이메일 인증'
  32. WHERE EmailTemplate_EmailVerifyFormTitle IS NULL;
  33. UPDATE Config SET
  34. EmailTemplate_EmailVerifyFormContent = N'<p>아래 링크를 클릭하여 이메일 인증을 완료해주세요.</p><p><a href=""{Url}"">{Url}</a></p><p>이 링크는 24시간 동안 유효합니다.</p>'
  35. WHERE EmailTemplate_EmailVerifyFormContent IS NULL;
  36. ");
  37. }
  38. /// <inheritdoc />
  39. protected override void Down(MigrationBuilder migrationBuilder)
  40. {
  41. }
  42. }
  43. }