legion-data 1.1.5 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rubocop-analysis.yml +28 -0
  3. data/.github/workflows/sourcehawk-scan.yml +20 -0
  4. data/.gitignore +5 -2
  5. data/.rubocop.yml +1 -7
  6. data/CHANGELOG.md +2 -14
  7. data/CODE_OF_CONDUCT.md +75 -0
  8. data/CONTRIBUTING.md +55 -0
  9. data/Gemfile +7 -1
  10. data/INDIVIDUAL_CONTRIBUTOR_LICENSE.md +30 -0
  11. data/LICENSE +201 -0
  12. data/NOTICE.txt +9 -0
  13. data/README.md +60 -23
  14. data/SECURITY.md +9 -0
  15. data/attribution.txt +1 -0
  16. data/legion-data.gemspec +22 -35
  17. data/lib/legion/data.rb +11 -12
  18. data/lib/legion/data/connection.rb +9 -9
  19. data/lib/legion/data/migration.rb +0 -0
  20. data/lib/legion/data/migrations/001_add_schema_columns.rb +0 -0
  21. data/lib/legion/data/migrations/002_add_nodes.rb +20 -0
  22. data/lib/legion/data/migrations/003_add_settings.rb +18 -0
  23. data/lib/legion/data/migrations/004_add_extensions.rb +25 -0
  24. data/lib/legion/data/migrations/005_add_runners.rb +21 -0
  25. data/lib/legion/data/migrations/006_add_functions.rb +23 -0
  26. data/lib/legion/data/migrations/{015_add_default_extensions.rb → 007_add_default_extensions.rb} +1 -0
  27. data/lib/legion/data/migrations/008_add_tasks.rb +29 -0
  28. data/lib/legion/data/model.rb +2 -2
  29. data/lib/legion/data/models/extension.rb +0 -0
  30. data/lib/legion/data/models/function.rb +2 -4
  31. data/lib/legion/data/models/node.rb +1 -3
  32. data/lib/legion/data/models/runner.rb +0 -0
  33. data/lib/legion/data/models/setting.rb +0 -0
  34. data/lib/legion/data/models/task.rb +0 -0
  35. data/lib/legion/data/models/task_log.rb +0 -0
  36. data/lib/legion/data/settings.rb +20 -20
  37. data/lib/legion/data/version.rb +1 -1
  38. data/sourcehawk.yml +4 -0
  39. metadata +37 -131
  40. data/.circleci/config.yml +0 -174
  41. data/.rspec +0 -1
  42. data/Gemfile.lock +0 -85
  43. data/Rakefile +0 -55
  44. data/bin/console +0 -14
  45. data/bin/setup +0 -8
  46. data/bitbucket-pipelines.yml +0 -26
  47. data/lib/legion/data/migrations/002_add_users.rb +0 -17
  48. data/lib/legion/data/migrations/003_add_groups.rb +0 -16
  49. data/lib/legion/data/migrations/004_add_chains.rb +0 -25
  50. data/lib/legion/data/migrations/005_add_envs.rb +0 -24
  51. data/lib/legion/data/migrations/006_add_dcs.rb +0 -24
  52. data/lib/legion/data/migrations/007_add_nodes.rb +0 -26
  53. data/lib/legion/data/migrations/008_add_settings.rb +0 -18
  54. data/lib/legion/data/migrations/009_add_extensions.rb +0 -25
  55. data/lib/legion/data/migrations/010_add_runners.rb +0 -21
  56. data/lib/legion/data/migrations/011_add_functions.rb +0 -29
  57. data/lib/legion/data/migrations/012_add_tasks.rb +0 -28
  58. data/lib/legion/data/migrations/013_add_task_logs.rb +0 -23
  59. data/lib/legion/data/migrations/014_add_relationships.rb +0 -27
  60. data/lib/legion/data/migrations/016_change_task_args.rb +0 -7
  61. data/lib/legion/data/migrations/017_add_payload_task.rb +0 -7
  62. data/lib/legion/data/migrations/018_add_migration_column.rb +0 -7
  63. data/lib/legion/data/migrations/019_add_debug_to_relationships.rb +0 -7
  64. data/lib/legion/data/migrations/020_add_delay_debug_to_tasks.rb +0 -8
  65. data/lib/legion/data/models/chain.rb +0 -11
  66. data/lib/legion/data/models/datacenter.rb +0 -11
  67. data/lib/legion/data/models/environment.rb +0 -11
  68. data/lib/legion/data/models/group.rb +0 -10
  69. data/lib/legion/data/models/relationship.rb +0 -16
  70. data/lib/legion/data/models/user.rb +0 -10
data/NOTICE.txt ADDED
@@ -0,0 +1,9 @@
1
+ Legion::Crypt(legion-crypt)
2
+ Copyright 2021 Optum
3
+
4
+ Project Description:
5
+ ====================
6
+ Manage
7
+
8
+ Author(s):
9
+ Esity
data/README.md CHANGED
@@ -1,37 +1,74 @@
1
- # Legion::Data
1
+ Legion::Data
2
+ =====
2
3
 
3
- Legion::Data is used by the framework to connect to a database. All database changes should be
4
- added as a migration with proper up/downs.
4
+ Legion::Data is a gem for the LegionIO framework to use persistent storage. Currently only MySQL is supported
5
5
 
6
- ## Installation
6
+ Supported Ruby versions and implementations
7
+ ------------------------------------------------
7
8
 
8
- Add this line to your application's Gemfile:
9
+ Legion::Json should work identically on:
9
10
 
10
- ```ruby
11
- gem 'legion-data'
12
- ```
11
+ * Ruby 2.5+
13
12
 
14
- And then execute:
15
13
 
16
- $ bundle
14
+ Installation and Usage
15
+ ------------------------
17
16
 
18
- Or install it yourself as:
17
+ You can verify your installation using this piece of code:
19
18
 
20
- $ gem install legion-data
19
+ ```bash
20
+ gem install legion-data
21
+ ```
21
22
 
22
- ## Usage
23
+ ```ruby
24
+ require 'legion/data'
23
25
 
24
- You can create a new connection to the database with the following example
25
- ``` Legion::Data::Connection.new.database.connection ```
26
- Keep in mind that if you need access to the database as part of a LEX, you should instead add it as a
27
- requirement inside your definitions with the following
26
+ Legion::Data.setup
27
+ Legion::Data.connected? # => true
28
+ Legion::Data::Model::Extension.all # Sequel::Dataset
28
29
  ```
29
- def requirements
30
- %w[legion-transport legion-data]
31
- end
30
+
31
+ Settings
32
+ ----------
33
+
34
+ ```json
35
+ {
36
+ "connected": false,
37
+ "cache": {
38
+ "connected": false,
39
+ "auto_enable": null,
40
+ "ttl": 60
41
+ },
42
+ "connection": {
43
+ "log": false,
44
+ "log_connection_info": false,
45
+ "log_warn_duration": 1,
46
+ "log_warn_duration": "debug",
47
+ "max_connections": 10,
48
+ "preconnect": false
49
+ },
50
+ "creds": {
51
+ "username": "legion",
52
+ "password": "legion",
53
+ "database": "legionio",
54
+ "host": "127.0.0.1",
55
+ "port": 3306
56
+ },
57
+ "migrations": {
58
+ "continue_on_fail": false,
59
+ "auto_migrate": true,
60
+ "ran": false,
61
+ "version": null
62
+ },
63
+ "models": {
64
+ "continue_on_load_fail": false,
65
+ "autoload": true
66
+ },
67
+ "connect_on_start": true
68
+ }
32
69
  ```
33
- and the framework will take care of the rest.
34
70
 
35
- ## Contributing
71
+ Authors
72
+ ----------
36
73
 
37
- Bug reports and pull requests are welcome on GitHub at https://bitbucket.org/legion-io/legion-data.
74
+ * [Matthew Iverson](https://github.com/Esity) - current maintainer
data/SECURITY.md ADDED
@@ -0,0 +1,9 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+ | Version | Supported |
5
+ | ------- | ------------------ |
6
+ | 1.x.x | :white_check_mark: |
7
+
8
+ ## Reporting a Vulnerability
9
+ To be added
data/attribution.txt ADDED
@@ -0,0 +1 @@
1
+ Add attributions here.
data/legion-data.gemspec CHANGED
@@ -1,46 +1,33 @@
1
- lib = File.expand_path('lib', __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'legion/data/version'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/legion/data/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = (RUBY_ENGINE == 'jruby' ? 'legion-data-java' : 'legion-data')
6
+ spec.name = 'legion-data'
7
7
  spec.version = Legion::Data::VERSION
8
8
  spec.authors = ['Esity']
9
- spec.email = ['matthewdiverson@gmail.com']
10
-
11
- spec.summary = 'Used by Legion to connect to the database'
12
- spec.description = 'The Legion connect gem'
13
- spec.homepage = 'https://bitbucket.org/legion-io/legion-data'
14
- spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
15
-
16
- spec.metadata['bug_tracker_uri'] = 'https://bitbucket.org/legion-io/legion-data/issues?status=new&status=open'
17
- spec.metadata['changelog_uri'] = 'https://bitbucket.org/legion-io/legion-data/src/CHANGELOG.md'
18
- spec.metadata['documentation_uri'] = 'https://bitbucket.org/legion-io/legion-data'
19
- spec.metadata['homepage_uri'] = 'https://bitbucket.org/legion-io/legion-data'
20
- spec.metadata['source_code_uri'] = 'https://bitbucket.org/legion-io/legion-data'
21
- spec.metadata['wiki_uri'] = 'https://bitbucket.org/legion-io/legion-data/wiki/Home'
9
+ spec.email = %w[matthewdiverson@gmail.com ruby@optum.com]
22
10
 
23
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
24
- f.match(%r{^(test|spec|features)/})
25
- end
26
- spec.bindir = 'bin'
27
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
11
+ spec.summary = 'Manages the connects to the backend database'
12
+ spec.description = 'A LegionIO gem to connect to a persistent data store'
13
+ spec.homepage = 'https://github.com/Optum/legion-data'
14
+ spec.license = 'Apache-2.0'
15
+ spec.required_ruby_version = '>= 2.5'
28
16
  spec.require_paths = ['lib']
29
-
30
- spec.add_development_dependency 'bundler'
31
- spec.add_development_dependency 'codecov'
32
- spec.add_development_dependency 'rake'
33
- spec.add_development_dependency 'rspec'
34
- spec.add_development_dependency 'rspec_junit_formatter'
35
- spec.add_development_dependency 'rubocop'
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.test_files = spec.files.select { |p| p =~ %r{^test/.*_test.rb} }
19
+ spec.extra_rdoc_files = %w[README.md LICENSE CHANGELOG.md]
20
+ spec.metadata = {
21
+ 'bug_tracker_uri' => 'https://github.com/Optum/legion-data/issues',
22
+ 'changelog_uri' => 'https://github.com/Optum/legion-data/src/main/CHANGELOG.md',
23
+ 'documentation_uri' => 'https://github.com/Optum/legion-data',
24
+ 'homepage_uri' => 'https://github.com/Optum/LegionIO',
25
+ 'source_code_uri' => 'https://github.com/Optum/legion-data',
26
+ 'wiki_uri' => 'https://github.com/Optum/legion-data/wiki'
27
+ }
36
28
 
37
29
  spec.add_dependency 'legion-logging'
38
30
  spec.add_dependency 'legion-settings'
39
-
40
- if RUBY_ENGINE == 'jruby'
41
- spec.add_dependency 'jdbc-mysql'
42
- else
43
- spec.add_dependency 'mysql2'
44
- end
31
+ spec.add_dependency 'mysql2'
45
32
  spec.add_dependency 'sequel'
46
33
  end
data/lib/legion/data.rb CHANGED
@@ -39,18 +39,17 @@ module Legion
39
39
 
40
40
  return unless defined?(::Legion::Cache)
41
41
 
42
- Legion::Data::Model::Relationship.plugin :caching, Legion::Cache, ttl: 10
43
- Legion::Data::Model::Runner.plugin :caching, Legion::Cache, ttl: 60
44
- Legion::Data::Model::Chain.plugin :caching, Legion::Cache, ttl: 60
45
- Legion::Data::Model::Datacenter.plugin :caching, Legion::Cache, ttl: 120
46
- Legion::Data::Model::Function.plugin :caching, Legion::Cache, ttl: 120
47
- Legion::Data::Model::Extension.plugin :caching, Legion::Cache, ttl: 120
48
- Legion::Data::Model::Node.plugin :caching, Legion::Cache, ttl: 10
49
- Legion::Data::Model::TaskLog.plugin :caching, Legion::Cache, ttl: 12
50
- Legion::Data::Model::Task.plugin :caching, Legion::Cache, ttl: 10
51
- Legion::Data::Model::User.plugin :caching, Legion::Cache, ttl: 120
52
- Legion::Data::Model::Group.plugin :caching, Legion::Cache, ttl: 120
53
- Legion::Logging.info 'Legion::Data connected to Legion::Cache'
42
+ # Legion::Data::Model::Relationship.plugin :caching, Legion::Cache, ttl: 10
43
+ # Legion::Data::Model::Runner.plugin :caching, Legion::Cache, ttl: 60
44
+ # Legion::Data::Model::Chain.plugin :caching, Legion::Cache, ttl: 60
45
+ # Legion::Data::Model::Function.plugin :caching, Legion::Cache, ttl: 120
46
+ # Legion::Data::Model::Extension.plugin :caching, Legion::Cache, ttl: 120
47
+ # Legion::Data::Model::Node.plugin :caching, Legion::Cache, ttl: 10
48
+ # Legion::Data::Model::TaskLog.plugin :caching, Legion::Cache, ttl: 12
49
+ # Legion::Data::Model::Task.plugin :caching, Legion::Cache, ttl: 10
50
+ # Legion::Data::Model::User.plugin :caching, Legion::Cache, ttl: 120
51
+ # Legion::Data::Model::Group.plugin :caching, Legion::Cache, ttl: 120
52
+ # Legion::Logging.info 'Legion::Data connected to Legion::Cache'
54
53
  end
55
54
 
56
55
  def shutdown
@@ -33,11 +33,11 @@ module Legion
33
33
  final_creds.merge! Legion::Data::Settings.creds
34
34
  final_creds.merge! Legion::Settings[:data][:creds] if Legion::Settings[:data][:creds].is_a? Hash
35
35
 
36
- if Legion::Settings[:data][:connection][:max_connections].is_a? Integer
37
- final_creds[:max_connections] = Legion::Settings[:data][:connection][:max_connections]
38
- end
36
+ # if Legion::Settings[:data][:connection][:max_connections].is_a? Integer
37
+ # final_creds[:max_connections] = Legion::Settings[:data][:connection][:max_connections]
38
+ # end
39
39
 
40
- final_creds[:preconnect] = :concurrently if Legion::Settings[:data][:connection][:preconnect]
40
+ # final_creds[:preconnect] = :concurrently if Legion::Settings[:data][:connection][:preconnect]
41
41
 
42
42
  return final_creds if Legion::Settings[:vault].nil?
43
43
 
@@ -52,11 +52,11 @@ module Legion
52
52
 
53
53
  def default_creds
54
54
  {
55
- host: '127.0.0.1',
56
- port: 3306,
57
- username: 'legion',
58
- password: 'legion',
59
- database: 'legion',
55
+ host: '127.0.0.1',
56
+ port: 3306,
57
+ username: 'legion',
58
+ password: 'legion',
59
+ database: 'legion',
60
60
  max_connections: 4
61
61
  }
62
62
  end
File without changes
File without changes
@@ -0,0 +1,20 @@
1
+ Sequel.migration do
2
+ up do
3
+ run "CREATE TABLE `nodes` (
4
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
+ `name` varchar(128) NOT NULL DEFAULT '',
6
+ `status` varchar(255) NOT NULL DEFAULT 'unknown',
7
+ `active` tinyint(1) unsigned NOT NULL DEFAULT '1',
8
+ `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
9
+ `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
10
+ PRIMARY KEY (`id`),
11
+ UNIQUE KEY `name` (`name`),
12
+ KEY `active` (`active`),
13
+ KEY `status` (`status`)
14
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
15
+ end
16
+
17
+ down do
18
+ drop_table :nodes
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ Sequel.migration do
2
+ up do
3
+ run "CREATE TABLE `settings` (
4
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
+ `key` varchar(128) NOT NULL,
6
+ `value` varchar(256) NOT NULL,
7
+ `encrypted` tinyint(1) unsigned NOT NULL DEFAULT '0',
8
+ `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
9
+ `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
10
+ PRIMARY KEY (`id`),
11
+ UNIQUE KEY `key` (`key`)
12
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
13
+ end
14
+
15
+ down do
16
+ drop_table :settings
17
+ end
18
+ end
@@ -0,0 +1,25 @@
1
+ Sequel.migration do
2
+ up do
3
+ run "CREATE TABLE `extensions` (
4
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
+ `active` tinyint(1) unsigned NOT NULL DEFAULT '1',
6
+ `name` varchar(128) NOT NULL,
7
+ `namespace` varchar(128) NOT NULL DEFAULT '',
8
+ `exchange` varchar(255) DEFAULT NULL,
9
+ `uri` varchar(256) DEFAULT NULL,
10
+ `schema_version` int(11) unsigned NOT NULL DEFAULT 0,
11
+ `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
12
+ `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
13
+ PRIMARY KEY (`id`),
14
+ UNIQUE KEY `name_namespace` (`name`,`namespace`),
15
+ KEY `active` (`active`),
16
+ KEY `name` (`name`),
17
+ KEY `namespace` (`namespace`),
18
+ key `schema_version` (`schema_version`)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
20
+ end
21
+
22
+ down do
23
+ drop_table :extensions
24
+ end
25
+ end
@@ -0,0 +1,21 @@
1
+ Sequel.migration do
2
+ up do
3
+ run "CREATE TABLE `runners` (
4
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
+ `extension_id` int(11) unsigned NOT NULL,
6
+ `name` varchar(256) NOT NULL DEFAULT '',
7
+ `namespace` varchar(256) NOT NULL DEFAULT '',
8
+ `active` tinyint(1) unsigned NOT NULL DEFAULT '1',
9
+ `queue` varchar(256) DEFAULT NULL,
10
+ `uri` varchar(256) DEFAULT NULL,
11
+ `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
12
+ `updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
13
+ PRIMARY KEY (`id`),
14
+ CONSTRAINT `runner_extension_id` FOREIGN KEY (`extension_id`) REFERENCES `extensions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
15
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
16
+ end
17
+
18
+ down do
19
+ drop_table :runners
20
+ end
21
+ end
@@ -0,0 +1,23 @@
1
+ Sequel.migration do
2
+ up do
3
+ run "CREATE TABLE `functions` (
4
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
+ `name` varchar(128) NOT NULL,
6
+ `active` tinyint(1) unsigned NOT NULL DEFAULT '1',
7
+ `runner_id` int(11) unsigned NOT NULL,
8
+ `args` text,
9
+ `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
10
+ `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
11
+ PRIMARY KEY (`id`),
12
+ UNIQUE KEY `runner_id` (`runner_id`,`name`),
13
+ KEY `active` (`active`),
14
+ KEY `namespace` (`runner_id`),
15
+ KEY `name` (`name`),
16
+ CONSTRAINT `function_runner_id` FOREIGN KEY (`runner_id`) REFERENCES `runners` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
17
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
18
+ end
19
+
20
+ down do
21
+ drop_table :functions
22
+ end
23
+ end
@@ -17,6 +17,7 @@ Sequel.migration do
17
17
  from(:runners).insert row
18
18
  end
19
19
  end
20
+
20
21
  down do
21
22
  from(:extensions).where(namespace: 'Legion::Extensions::Lex').delete
22
23
  from(:extensions).where(namespace: 'Legion::Extensions::Node').delete
@@ -0,0 +1,29 @@
1
+ Sequel.migration do
2
+ up do
3
+ run "CREATE TABLE `tasks` (
4
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
+ `relationship_id` int(11) unsigned DEFAULT NULL,
6
+ `function_id` int(11) unsigned DEFAULT NULL,
7
+ `status` varchar(255) NOT NULL,
8
+ `parent_id` int(11) unsigned DEFAULT NULL,
9
+ `master_id` int(11) unsigned DEFAULT NULL,
10
+ `function_args` text,
11
+ `results` text,
12
+ `payload` text,
13
+ `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
14
+ `updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
15
+ PRIMARY KEY (`id`),
16
+ KEY `status` (`status`),
17
+ KEY `parent_id` (`parent_id`),
18
+ KEY `master_id` (`master_id`),
19
+ KEY `relationship_id` (`relationship_id`),
20
+ KEY `function_id` (`function_id`),
21
+ CONSTRAINT `parent_id` FOREIGN KEY (`parent_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
22
+ CONSTRAINT `master_id` FOREIGN KEY (`master_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
23
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
24
+ end
25
+
26
+ down do
27
+ drop_table :tasks
28
+ end
29
+ end
@@ -5,7 +5,7 @@ module Legion
5
5
  attr_reader :loaded_models
6
6
 
7
7
  def models
8
- %w[user group extension chain relationship function task runner task_log datacenter environment node setting]
8
+ %w[extension function task runner node setting]
9
9
  end
10
10
 
11
11
  def load
@@ -16,7 +16,7 @@ module Legion
16
16
  end
17
17
 
18
18
  def require_sequel_models(files = models)
19
- Dir["#{File.dirname(__FILE__)}models/*.rb"].each { |file| puts file }
19
+ # Dir["#{File.dirname(__FILE__)}models/*.rb"].each { |file| puts file }
20
20
  files.each { |file| load_sequel_model(file) }
21
21
  end
22
22
 
File without changes
@@ -1,14 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'relationship'
4
-
5
3
  module Legion
6
4
  module Data
7
5
  module Model
8
6
  class Function < Sequel::Model
9
7
  many_to_one :runner
10
- one_to_many :trigger_relationships, class: 'Legion::Data::Model::Relationship', key: :trigger_id
11
- one_to_many :action_relationships, class: 'Legion::Data::Model::Relationship', key: :action_id
8
+ # one_to_many :trigger_relationships, class: 'Legion::Data::Model::Relationship', key: :trigger_id
9
+ # one_to_many :action_relationships, class: 'Legion::Data::Model::Relationship', key: :action_id
12
10
  end
13
11
  end
14
12
  end