20210308000001_github_support.rb 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class GitHubSupport < 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: 'GitHub integration',
  8. name: 'github_integration',
  9. area: 'Integration::Switch',
  10. description: 'Defines if the GitHub (http://www.github.com) integration is enabled or not.',
  11. options: {
  12. form: [
  13. {
  14. display: '',
  15. null: true,
  16. name: 'github_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: 'GitHub config',
  35. name: 'github_config',
  36. area: 'Integration::GitHub',
  37. description: 'Stores the GitHub configuration.',
  38. options: {},
  39. state: {
  40. endpoint: 'https://api.github.com/graphql',
  41. },
  42. preferences: {
  43. prio: 2,
  44. permission: ['admin.integration'],
  45. },
  46. frontend: false,
  47. )
  48. end
  49. end