libis-workflow-activerecord 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5e5ca19333207c2454878483bec80747d8af6717
4
- data.tar.gz: 4006386a833854575803812cb7f379f43baafb21
2
+ SHA256:
3
+ metadata.gz: e3b864ebd79697b212e8e398b7c98080e22238ff38efa0d9e16f8ce2862e9904
4
+ data.tar.gz: 89b6d5b72c99d3fa5bebcd63e03df3f29cafb95ecf76b179bac8649f9fb1ffad
5
5
  SHA512:
6
- metadata.gz: f90d6c9a59ccbaec455a9ece2bf6759d60ba2bddafbecf3f37470117eb2b2ec7738c2f942c80fdf81825a57abd641343ac4acb75817a7d0861f5de26495ba69e
7
- data.tar.gz: 4fc925d21262f45aa265658ac39cbc558401dd40057bdfc7be801429a8b5522309ec299d978ed9f624360b6c3483b01352e340570159a692fc552614760a4fba
6
+ metadata.gz: adffbcd7031d6d01291ee8a00e64f46b084f8a12e7b834bf232f42200d87b805be56540251fefb2c2d150d40260094776065dbee422b153b5bfeaf6f6ce4a197
7
+ data.tar.gz: ff0e83c3a87d4197814486bb34367215d91f8807966ed6ca5fc0273329f6fe3da33709bc7297ae5cff9330ec9bc017a10df7d051c017fb80f0ce6d3834e78a85
data/db/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  default: &default
2
2
  adapter: postgresql
3
- encoding: unicode
3
+ encoding: utf-8
4
4
  database: upload
5
5
  host: localhost
6
6
  port: 5432
@@ -38,7 +38,7 @@ development:
38
38
  # debug5, debug4, debug3, debug2, debug1,
39
39
  # log, notice, warning, error, fatal, and panic
40
40
  # Defaults to warning.
41
- min_messages: debug5
41
+ min_messages: log
42
42
 
43
43
  # Warning: The database defined as "test" will be erased and
44
44
  # re-generated from your development database when you run "rake".
@@ -0,0 +1,25 @@
1
+ require 'libis/workflow/activerecord'
2
+
3
+ class CreateWorkflowTable < ActiveRecord::Migration[5.0]
4
+
5
+ def change
6
+
7
+ create_table :workflows do |t|
8
+ t.string :type
9
+ t.string :name
10
+ t.text :description
11
+ if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "postgresql"
12
+ t.jsonb :config, default: {}
13
+ else
14
+ t.json :config, default: {}
15
+ end
16
+
17
+ t.timestamps
18
+ end
19
+
20
+ if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "postgresql"
21
+ add_index :workflows, :config, using: :gin
22
+ end
23
+
24
+ end
25
+ end
@@ -1,13 +1,18 @@
1
1
  require 'libis/workflow/activerecord'
2
2
 
3
- class CreateWorkflowItemsTable < ActiveRecord::Migration[5.0]
3
+ class CreateJobsTable < ActiveRecord::Migration[5.0]
4
4
 
5
5
  def change
6
+
6
7
  create_table :jobs do |t|
7
8
  t.string :type
8
9
  t.string :name
9
- t.string :description
10
- t.jsonb :input
10
+ t.text :description
11
+ if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "postgresql"
12
+ t.jsonb :input, default: {}
13
+ else
14
+ t.json :input, default: {}
15
+ end
11
16
  t.string :run_object
12
17
  t.boolean :log_to_file, default: true
13
18
  t.boolean :log_each_run, default: true
@@ -16,12 +21,14 @@ class CreateWorkflowItemsTable < ActiveRecord::Migration[5.0]
16
21
  # noinspection RubyResolve
17
22
  t.integer :log_keep, default: 5
18
23
 
24
+ t.references :workflow, foreign_key: {to_table: :workflows, on_delete: :cascade}
25
+
19
26
  t.timestamps
27
+ end
20
28
 
21
- t.integer :run_id
22
- t.integer :workflow_id
29
+ if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "postgresql"
30
+ add_index :jobs, :input, using: :gin
23
31
  end
24
32
 
25
- add_index :jobs, :workflow_id
26
33
  end
27
34
  end
@@ -0,0 +1,29 @@
1
+ require 'libis/workflow/activerecord'
2
+
3
+ class CreateWorkItemsTable < ActiveRecord::Migration[5.0]
4
+
5
+ def change
6
+
7
+ create_table :work_items do |t|
8
+ t.string :type
9
+ if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "postgresql"
10
+ t.jsonb :properties
11
+ t.jsonb :options
12
+ t.jsonb :status_log
13
+ else
14
+ t.json :properties
15
+ t.json :options
16
+ t.json :status_log
17
+ end
18
+ t.references :parent, foreign_key: {to_table: :work_items, on_delete: :cascade}
19
+ t.references :job, foreign_key: {to_table: :jobs, on_delete: :cascade}
20
+
21
+ t.timestamps
22
+ end
23
+
24
+ if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "postgresql"
25
+ add_index :work_items, :status_log, using: :gin
26
+ end
27
+
28
+ end
29
+ end
data/db/schema.rb CHANGED
@@ -39,10 +39,9 @@ ActiveRecord::Schema.define do
39
39
  # noinspection RubyResolve
40
40
  t.integer :log_keep, default: 5
41
41
 
42
- t.timestamps
43
-
44
42
  t.references :workflow, foreign_key: {to_table: :workflows, on_delete: :cascade}
45
- t.integer :workflow_id
43
+
44
+ t.timestamps
46
45
  end
47
46
 
48
47
  if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "postgresql"
@@ -62,6 +61,7 @@ ActiveRecord::Schema.define do
62
61
  end
63
62
  t.references :parent, foreign_key: {to_table: :work_items, on_delete: :cascade}
64
63
  t.references :job, foreign_key: {to_table: :jobs, on_delete: :cascade}
64
+
65
65
  t.timestamps
66
66
  end
67
67
 
@@ -1,7 +1,7 @@
1
1
  module Libis
2
2
  module Workflow
3
3
  module ActiveRecord
4
- VERSION = '0.9.0' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
4
+ VERSION = '0.9.1' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-workflow-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-05 00:00:00.000000000 Z
11
+ date: 2018-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libis-workflow
@@ -163,8 +163,9 @@ files:
163
163
  - README.md
164
164
  - Rakefile
165
165
  - db/config.yml
166
- - db/migrate/001_create_work_items_table.rb
166
+ - db/migrate/001_create_workflow_table.rb
167
167
  - db/migrate/002_create_jobs_table.rb
168
+ - db/migrate/003_create_work_items_table.rb
168
169
  - db/schema.rb
169
170
  - db/setup_db.rb
170
171
  - db/travis.config.yml
@@ -220,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
221
  version: '0'
221
222
  requirements: []
222
223
  rubyforge_project:
223
- rubygems_version: 2.5.1
224
+ rubygems_version: 2.7.6
224
225
  signing_key:
225
226
  specification_version: 4
226
227
  summary: ActiveRecord persistence for the LIBIS Workflow framework.
@@ -1,18 +0,0 @@
1
- require 'libis/workflow/activerecord'
2
-
3
- class CreateWorkflowItemsTable < ActiveRecord::Migration[5.0]
4
-
5
- def change
6
- create_table :work_items do |t|
7
- t.string :type
8
- t.jsonb :properties
9
- t.jsonb :options
10
- t.jsonb :status_log
11
- t.references :parent, foreign_key: {to_table: :work_items, on_delete: :cascade}
12
-
13
- t.timestamps
14
- end
15
-
16
- add_index :work_items, :status_log, using: :gin
17
- end
18
- end