20210113000001_gitlab_support.rb 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class GitLabSupport < 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. Setting.create_if_not_exists(
  7. title: 'GitLab integration',
  8. name: 'gitlab_integration',
  9. area: 'Integration::Switch',
  10. description: 'Defines if the GitLab (http://www.gitlab.com) integration is enabled or not.',
  11. options: {
  12. form: [
  13. {
  14. display: '',
  15. null: true,
  16. name: 'gitlab_integration',
  17. tag: 'boolean',
  18. options: {
  19. true => 'yes',
  20. false => 'no',
  21. },
  22. },
  23. ],
  24. },
  25. state: false,
  26. preferences: {
  27. prio: 1,
  28. authentication: true,
  29. permission: ['admin.integration'],
  30. },
  31. frontend: true
  32. )
  33. Setting.create_if_not_exists(
  34. title: 'GitLab config',
  35. name: 'gitlab_config',
  36. area: 'Integration::GitLab',
  37. description: 'Stores the GitLab configuration.',
  38. options: {},
  39. state: {
  40. endpoint: 'https://gitlab.com/api/graphql',
  41. },
  42. preferences: {
  43. prio: 2,
  44. permission: ['admin.integration'],
  45. },
  46. frontend: false,
  47. )
  48. end
  49. end