20210113000001_gitlab_support.rb 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. class GitLabSupport < ActiveRecord::Migration[4.2]
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.exists?(name: 'system_init_done')
  5. Setting.create_if_not_exists(
  6. title: 'GitLab integration',
  7. name: 'gitlab_integration',
  8. area: 'Integration::Switch',
  9. description: 'Defines if the GitLab (http://www.gitlab.com) integration is enabled or not.',
  10. options: {
  11. form: [
  12. {
  13. display: '',
  14. null: true,
  15. name: 'gitlab_integration',
  16. tag: 'boolean',
  17. options: {
  18. true => 'yes',
  19. false => 'no',
  20. },
  21. },
  22. ],
  23. },
  24. state: false,
  25. preferences: {
  26. prio: 1,
  27. authentication: true,
  28. permission: ['admin.integration'],
  29. },
  30. frontend: true
  31. )
  32. Setting.create_if_not_exists(
  33. title: 'GitLab config',
  34. name: 'gitlab_config',
  35. area: 'Integration::GitLab',
  36. description: 'Stores the GitLab configuration.',
  37. options: {},
  38. state: {
  39. endpoint: 'https://gitlab.com/api/graphql',
  40. },
  41. preferences: {
  42. prio: 2,
  43. permission: ['admin.integration'],
  44. },
  45. frontend: false,
  46. )
  47. end
  48. end