20170714000001_object_manager_user_email_optional.rb 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class ObjectManagerUserEmailOptional < ActiveRecord::Migration[4.2]
  3. def up
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. ObjectManager::Attribute.add(
  7. force: true,
  8. object: 'User',
  9. name: 'email',
  10. display: 'Email',
  11. data_type: 'input',
  12. data_option: {
  13. type: 'email',
  14. maxlength: 150,
  15. null: true,
  16. item_class: 'formGroup--halfSize',
  17. },
  18. editable: false,
  19. active: true,
  20. screens: {
  21. signup: {
  22. '-all-' => {
  23. null: false,
  24. },
  25. },
  26. invite_agent: {
  27. '-all-' => {
  28. null: false,
  29. },
  30. },
  31. invite_customer: {
  32. '-all-' => {
  33. null: false,
  34. },
  35. },
  36. edit: {
  37. '-all-' => {
  38. null: true,
  39. },
  40. },
  41. view: {
  42. '-all-' => {
  43. shown: true,
  44. },
  45. },
  46. },
  47. to_create: false,
  48. to_migrate: false,
  49. to_delete: false,
  50. position: 400,
  51. )
  52. end
  53. end