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.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop-analysis.yml +28 -0
- data/.github/workflows/sourcehawk-scan.yml +20 -0
- data/.gitignore +5 -2
- data/.rubocop.yml +1 -7
- data/CHANGELOG.md +2 -14
- data/CODE_OF_CONDUCT.md +75 -0
- data/CONTRIBUTING.md +55 -0
- data/Gemfile +7 -1
- data/INDIVIDUAL_CONTRIBUTOR_LICENSE.md +30 -0
- data/LICENSE +201 -0
- data/NOTICE.txt +9 -0
- data/README.md +60 -23
- data/SECURITY.md +9 -0
- data/attribution.txt +1 -0
- data/legion-data.gemspec +22 -35
- data/lib/legion/data.rb +11 -12
- data/lib/legion/data/connection.rb +9 -9
- data/lib/legion/data/migration.rb +0 -0
- data/lib/legion/data/migrations/001_add_schema_columns.rb +0 -0
- data/lib/legion/data/migrations/002_add_nodes.rb +20 -0
- data/lib/legion/data/migrations/003_add_settings.rb +18 -0
- data/lib/legion/data/migrations/004_add_extensions.rb +25 -0
- data/lib/legion/data/migrations/005_add_runners.rb +21 -0
- data/lib/legion/data/migrations/006_add_functions.rb +23 -0
- data/lib/legion/data/migrations/{015_add_default_extensions.rb → 007_add_default_extensions.rb} +1 -0
- data/lib/legion/data/migrations/008_add_tasks.rb +29 -0
- data/lib/legion/data/model.rb +2 -2
- data/lib/legion/data/models/extension.rb +0 -0
- data/lib/legion/data/models/function.rb +2 -4
- data/lib/legion/data/models/node.rb +1 -3
- data/lib/legion/data/models/runner.rb +0 -0
- data/lib/legion/data/models/setting.rb +0 -0
- data/lib/legion/data/models/task.rb +0 -0
- data/lib/legion/data/models/task_log.rb +0 -0
- data/lib/legion/data/settings.rb +20 -20
- data/lib/legion/data/version.rb +1 -1
- data/sourcehawk.yml +4 -0
- metadata +37 -131
- data/.circleci/config.yml +0 -174
- data/.rspec +0 -1
- data/Gemfile.lock +0 -85
- data/Rakefile +0 -55
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/bitbucket-pipelines.yml +0 -26
- data/lib/legion/data/migrations/002_add_users.rb +0 -17
- data/lib/legion/data/migrations/003_add_groups.rb +0 -16
- data/lib/legion/data/migrations/004_add_chains.rb +0 -25
- data/lib/legion/data/migrations/005_add_envs.rb +0 -24
- data/lib/legion/data/migrations/006_add_dcs.rb +0 -24
- data/lib/legion/data/migrations/007_add_nodes.rb +0 -26
- data/lib/legion/data/migrations/008_add_settings.rb +0 -18
- data/lib/legion/data/migrations/009_add_extensions.rb +0 -25
- data/lib/legion/data/migrations/010_add_runners.rb +0 -21
- data/lib/legion/data/migrations/011_add_functions.rb +0 -29
- data/lib/legion/data/migrations/012_add_tasks.rb +0 -28
- data/lib/legion/data/migrations/013_add_task_logs.rb +0 -23
- data/lib/legion/data/migrations/014_add_relationships.rb +0 -27
- data/lib/legion/data/migrations/016_change_task_args.rb +0 -7
- data/lib/legion/data/migrations/017_add_payload_task.rb +0 -7
- data/lib/legion/data/migrations/018_add_migration_column.rb +0 -7
- data/lib/legion/data/migrations/019_add_debug_to_relationships.rb +0 -7
- data/lib/legion/data/migrations/020_add_delay_debug_to_tasks.rb +0 -8
- data/lib/legion/data/models/chain.rb +0 -11
- data/lib/legion/data/models/datacenter.rb +0 -11
- data/lib/legion/data/models/environment.rb +0 -11
- data/lib/legion/data/models/group.rb +0 -10
- data/lib/legion/data/models/relationship.rb +0 -16
- data/lib/legion/data/models/user.rb +0 -10
@@ -1,23 +0,0 @@
|
|
1
|
-
Sequel.migration do
|
2
|
-
up do
|
3
|
-
run "CREATE TABLE `task_logs` (
|
4
|
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
5
|
-
`task_id` int(11) unsigned NOT NULL,
|
6
|
-
`function_id` int(11) unsigned,
|
7
|
-
`node_id` int(11) unsigned,
|
8
|
-
`entry` text NOT NULL,
|
9
|
-
`created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
10
|
-
`updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
11
|
-
PRIMARY KEY (`id`),
|
12
|
-
KEY (`created`),
|
13
|
-
KEY (`updated`),
|
14
|
-
CONSTRAINT `task_log_task_id` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
15
|
-
CONSTRAINT `task_log_functions` FOREIGN KEY (`function_id`) REFERENCES `functions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
16
|
-
CONSTRAINT `task_log_nodes` FOREIGN KEY (`node_id`) REFERENCES `nodes` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
17
|
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
|
18
|
-
end
|
19
|
-
|
20
|
-
down do
|
21
|
-
drop_table :task_logs
|
22
|
-
end
|
23
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
Sequel.migration do
|
2
|
-
up do
|
3
|
-
run "CREATE TABLE `relationships` (
|
4
|
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
5
|
-
`name` varchar(255) DEFAULT NULL,
|
6
|
-
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
|
7
|
-
`chain_id` int(11) unsigned DEFAULT NULL,
|
8
|
-
`trigger_id` int(11) unsigned NOT NULL,
|
9
|
-
`action_id` int(11) unsigned NOT NULL,
|
10
|
-
`delay` int(11) unsigned NOT NULL DEFAULT '0',
|
11
|
-
`allow_new_chains` tinyint(1) unsigned NOT NULL DEFAULT '1',
|
12
|
-
`conditions` text,
|
13
|
-
`transformation` text,
|
14
|
-
`created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
15
|
-
`updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
16
|
-
PRIMARY KEY (`id`),
|
17
|
-
KEY `chain_id` (`chain_id`),
|
18
|
-
CONSTRAINT `function_chain_id` FOREIGN KEY (`chain_id`) REFERENCES `chains` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
19
|
-
CONSTRAINT `relationship_action_id` FOREIGN KEY (`action_id`) REFERENCES `functions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
20
|
-
CONSTRAINT `relationship_trigger_id` FOREIGN KEY (`trigger_id`) REFERENCES `functions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
21
|
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
|
22
|
-
end
|
23
|
-
|
24
|
-
down do
|
25
|
-
drop_table :relationships
|
26
|
-
end
|
27
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'function'
|
4
|
-
|
5
|
-
module Legion
|
6
|
-
module Data
|
7
|
-
module Model
|
8
|
-
class Relationship < Sequel::Model
|
9
|
-
many_to_one :chain
|
10
|
-
one_to_many :task
|
11
|
-
many_to_one :trigger, class: Legion::Data::Model::Function
|
12
|
-
many_to_one :action, class: Legion::Data::Model::Function
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|