20210308000001_github_support.rb 1.3 KB

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