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/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
data/Gemfile.lock DELETED
@@ -1,85 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- legion-data (1.1.5)
5
- legion-logging
6
- legion-settings
7
- mysql2
8
- sequel
9
-
10
- GEM
11
- remote: https://rubygems.org/
12
- specs:
13
- ast (2.4.1)
14
- codecov (0.2.12)
15
- json
16
- simplecov
17
- diff-lcs (1.4.4)
18
- docile (1.3.2)
19
- json (2.3.1)
20
- json_pure (2.3.1)
21
- legion-json (1.1.2)
22
- json_pure
23
- multi_json
24
- legion-logging (1.1.3)
25
- rainbow (~> 3)
26
- legion-settings (1.1.2)
27
- legion-json
28
- legion-logging
29
- multi_json (1.15.0)
30
- mysql2 (0.5.3)
31
- parallel (1.19.2)
32
- parser (2.7.2.0)
33
- ast (~> 2.4.1)
34
- rainbow (3.0.0)
35
- rake (13.0.1)
36
- regexp_parser (1.8.2)
37
- rexml (3.2.4)
38
- rspec (3.9.0)
39
- rspec-core (~> 3.9.0)
40
- rspec-expectations (~> 3.9.0)
41
- rspec-mocks (~> 3.9.0)
42
- rspec-core (3.9.3)
43
- rspec-support (~> 3.9.3)
44
- rspec-expectations (3.9.3)
45
- diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.9.0)
47
- rspec-mocks (3.9.1)
48
- diff-lcs (>= 1.2.0, < 2.0)
49
- rspec-support (~> 3.9.0)
50
- rspec-support (3.9.4)
51
- rspec_junit_formatter (0.4.1)
52
- rspec-core (>= 2, < 4, != 2.12.0)
53
- rubocop (1.0.0)
54
- parallel (~> 1.10)
55
- parser (>= 2.7.1.5)
56
- rainbow (>= 2.2.2, < 4.0)
57
- regexp_parser (>= 1.8)
58
- rexml
59
- rubocop-ast (>= 0.6.0)
60
- ruby-progressbar (~> 1.7)
61
- unicode-display_width (>= 1.4.0, < 2.0)
62
- rubocop-ast (1.1.0)
63
- parser (>= 2.7.1.5)
64
- ruby-progressbar (1.10.1)
65
- sequel (5.37.0)
66
- simplecov (0.19.1)
67
- docile (~> 1.1)
68
- simplecov-html (~> 0.11)
69
- simplecov-html (0.12.3)
70
- unicode-display_width (1.7.0)
71
-
72
- PLATFORMS
73
- ruby
74
-
75
- DEPENDENCIES
76
- bundler
77
- codecov
78
- legion-data!
79
- rake
80
- rspec
81
- rspec_junit_formatter
82
- rubocop
83
-
84
- BUNDLED WITH
85
- 2.1.4
data/Rakefile DELETED
@@ -1,55 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
- require 'rubocop/rake_task'
4
-
5
- RSpec::Core::RakeTask.new(:spec)
6
-
7
- task default: :spec
8
-
9
- task :dev do
10
- end
11
-
12
- RuboCop::RakeTask.new(:rubocop) do |t|
13
- t.options = ['--display-cop-names']
14
- end
15
-
16
- RuboCop::RakeTask.new(:rubocop_fix) do |t|
17
- # t.options = ['--display-cop-names -a']
18
- t.options = ['--display-cop-names']
19
- end
20
-
21
- namespace :db do
22
- require 'sequel'
23
- require 'legion/logging'
24
- Sequel.extension :migration
25
-
26
- # desc 'Prints current schema version'
27
- # task :version do
28
- # version = DB[:schema_info].first[:version] # if DB.tables.include?(:schema_info) || true
29
- #
30
- # puts "Schema Version: #{version}"
31
- # end
32
- #
33
- # desc 'Perform migration up to latest migration available'
34
- # task :migrate do
35
- # Sequel::Migrator.run(DB, 'lib/legion/data/migrations')
36
- # Rake::Task['db:version'].execute
37
- # end
38
- #
39
- # desc 'Perform rollback to specified target or full rollback as default'
40
- # task :rollback, :target do |_t, args|
41
- # args.with_defaults(target: 0)
42
- #
43
- # Sequel::Migrator.run(DB, 'lib/legion/data/migrations', target: args[:target].to_i)
44
- # Rake::Task['db:version'].execute
45
- # end
46
- #
47
- # desc 'Perform migration reset (full rollback and migration)'
48
- # task :reset do
49
- # Sequel::Migrator.run(DB, 'migrations', target: 0)
50
- # Sequel::Migrator.run(DB, 'migrations')
51
- # Rake::Task['db:version'].execute
52
- # end
53
- end
54
-
55
- # RuboCop::RakeTask.new
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'bundler/setup'
4
- require 'legion/data'
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require 'irb'
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,26 +0,0 @@
1
- image: ruby:2.4.0
2
-
3
- pipelines:
4
- branches:
5
- master:
6
- - step:
7
- caches:
8
- - bundler
9
- script:
10
- - gem install bundle rubocop
11
- - bundle install
12
- - rubocop
13
- - rake
14
- services:
15
- - mysql
16
- definitions:
17
- services:
18
- mysql:
19
- image: mysql:5.7
20
- environment:
21
- MYSQL_DATABASE: 'legion'
22
- MYSQL_ROOT_PASSWORD: 'legion'
23
- MYSQL_USER: 'legion'
24
- MYSQL_PASSWORD: 'legion'
25
- caches:
26
- bundler: vendor/bundle
@@ -1,17 +0,0 @@
1
- Sequel.migration do
2
- up do
3
- run "CREATE TABLE `users` (
4
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
- `active` tinyint(1) unsigned DEFAULT '1',
6
- `name` varchar(128) DEFAULT NULL,
7
- `version` tinyint(5) 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
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
12
- end
13
-
14
- down do
15
- drop_table :users
16
- end
17
- end
@@ -1,16 +0,0 @@
1
- Sequel.migration do
2
- up do
3
- run "CREATE TABLE `groups` (
4
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
- `name` varchar(128) DEFAULT NULL,
6
- `active` tinyint(1) unsigned DEFAULT '1',
7
- `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
8
- `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
9
- PRIMARY KEY (`id`)
10
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
11
- end
12
-
13
- down do
14
- drop_table :groups
15
- end
16
- end
@@ -1,25 +0,0 @@
1
- Sequel.migration do
2
- up do
3
- run "CREATE TABLE `chains` (
4
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
- `name` varchar(128) NOT NULL DEFAULT '',
6
- `active` tinyint(1) unsigned DEFAULT '1',
7
- `version` int(11) unsigned NOT NULL DEFAULT '1',
8
- `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
9
- `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
10
- `user_owner` int(11) unsigned DEFAULT NULL,
11
- `group_owner` int(11) unsigned DEFAULT NULL,
12
- PRIMARY KEY (`id`),
13
- UNIQUE KEY `name` (`name`),
14
- KEY `active` (`active`),
15
- KEY `chains_user_owner` (`user_owner`),
16
- KEY `chains_group_owner` (`group_owner`),
17
- CONSTRAINT `chains_group_owner` FOREIGN KEY (`group_owner`) REFERENCES `groups` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
18
- CONSTRAINT `chains_user_owner` FOREIGN KEY (`user_owner`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
19
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
20
- end
21
-
22
- down do
23
- drop_table :chains
24
- end
25
- end
@@ -1,24 +0,0 @@
1
- Sequel.migration do
2
- up do
3
- run "CREATE TABLE `environments` (
4
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
- `name` varchar(128) NOT NULL DEFAULT '',
6
- `active` tinyint(1) unsigned NOT NULL DEFAULT '1',
7
- `user_owner` int(11) unsigned DEFAULT NULL,
8
- `group_owner` int(11) unsigned DEFAULT NULL,
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 `name` (`name`),
13
- KEY `active` (`active`),
14
- KEY `environments_user_owner` (`user_owner`),
15
- KEY `environments_group_owner` (`group_owner`),
16
- CONSTRAINT `environments_group_owner` FOREIGN KEY (`group_owner`) REFERENCES `groups` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
17
- CONSTRAINT `environments_user_owner` FOREIGN KEY (`user_owner`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
18
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
19
- end
20
-
21
- down do
22
- drop_table :environments
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- Sequel.migration do
2
- up do
3
- run "CREATE TABLE `datacenters` (
4
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
- `name` varchar(128) NOT NULL DEFAULT '',
6
- `active` tinyint(1) unsigned NOT NULL DEFAULT '1',
7
- `user_owner` int(11) unsigned DEFAULT NULL,
8
- `group_owner` int(11) unsigned DEFAULT NULL,
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 `name` (`name`),
13
- KEY `active` (`active`),
14
- KEY `datacenters_user_owner` (`user_owner`),
15
- KEY `datacenters_group_owner` (`group_owner`),
16
- CONSTRAINT `datacenters_group_owner` FOREIGN KEY (`group_owner`) REFERENCES `groups` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
17
- CONSTRAINT `datacenters_user_owner` FOREIGN KEY (`user_owner`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
18
- ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;"
19
- end
20
-
21
- down do
22
- drop_table :datacenters
23
- end
24
- end
@@ -1,26 +0,0 @@
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
- `datacenter_id` int(11) unsigned DEFAULT NULL,
7
- `environment_id` int(11) unsigned DEFAULT NULL,
8
- `status` varchar(255) NOT NULL DEFAULT 'unknown',
9
- `active` tinyint(1) unsigned NOT NULL DEFAULT '1',
10
- `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
11
- `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
12
- PRIMARY KEY (`id`),
13
- UNIQUE KEY `name` (`name`),
14
- KEY `active` (`active`),
15
- KEY `status` (`status`),
16
- KEY `node_datacenter_id` (`datacenter_id`),
17
- KEY `node_environment_id` (`environment_id`),
18
- CONSTRAINT `node_datacenter_id` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
19
- CONSTRAINT `node_environment_id` FOREIGN KEY (`environment_id`) REFERENCES `environments` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
20
- ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;"
21
- end
22
-
23
- down do
24
- drop_table :nodes
25
- end
26
- end
@@ -1,18 +0,0 @@
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
@@ -1,25 +0,0 @@
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
- `user_owner` int(11) unsigned DEFAULT NULL,
11
- `group_owner` int(11) unsigned DEFAULT NULL,
12
- `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
13
- `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
14
- PRIMARY KEY (`id`),
15
- UNIQUE KEY `name_namespace` (`name`,`namespace`),
16
- KEY `active` (`active`),
17
- KEY `name` (`name`),
18
- KEY `namespace` (`namespace`)
19
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
20
- end
21
-
22
- down do
23
- drop_table :extensions
24
- end
25
- end
@@ -1,21 +0,0 @@
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
@@ -1,29 +0,0 @@
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
- `user_owner` int(11) unsigned DEFAULT NULL,
10
- `group_owner` int(11) unsigned DEFAULT NULL,
11
- `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
12
- `updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
13
- PRIMARY KEY (`id`),
14
- UNIQUE KEY `runner_id` (`runner_id`,`name`),
15
- KEY `active` (`active`),
16
- KEY `namespace` (`runner_id`),
17
- KEY `name` (`name`),
18
- KEY `functions_user_owner` (`user_owner`),
19
- KEY `functions_group_owner` (`group_owner`),
20
- CONSTRAINT `function_runner_id` FOREIGN KEY (`runner_id`) REFERENCES `runners` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
21
- CONSTRAINT `functions_group_owner` FOREIGN KEY (`group_owner`) REFERENCES `groups` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
22
- CONSTRAINT `functions_user_owner` FOREIGN KEY (`user_owner`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
23
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
24
- end
25
-
26
- down do
27
- drop_table :functions
28
- end
29
- end
@@ -1,28 +0,0 @@
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
- `args` text,
11
- `results` text,
12
- `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
13
- `updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
14
- PRIMARY KEY (`id`),
15
- KEY `status` (`status`),
16
- KEY `parent_id` (`parent_id`),
17
- KEY `master_id` (`master_id`),
18
- KEY `relationship_id` (`relationship_id`),
19
- KEY `function_id` (`function_id`),
20
- CONSTRAINT `parent_id` FOREIGN KEY (`parent_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
21
- CONSTRAINT `master_id` FOREIGN KEY (`master_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
22
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
23
- end
24
-
25
- down do
26
- drop_table :tasks
27
- end
28
- end