jobshop 0.0.167 → 0.0.179

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -2
  3. data/Rakefile +2 -1
  4. data/app/assets/javascripts/application.js +1 -0
  5. data/app/controllers/jobshop/application_controller.rb +3 -1
  6. data/app/controllers/jobshop/dashboards_controller.rb +11 -0
  7. data/app/controllers/jobshop/departments_controller.rb +52 -0
  8. data/app/controllers/jobshop/employees_controller.rb +77 -0
  9. data/app/controllers/jobshop/organizations_controller.rb +29 -0
  10. data/app/controllers/jobshop/rfqs_controller.rb +49 -0
  11. data/app/controllers/jobshop/roles_controller.rb +52 -0
  12. data/app/helpers/jobshop/application_helper.rb +10 -0
  13. data/app/listeners/jobshop/assignment_listener.rb +13 -0
  14. data/app/mailers/jobshop/rfq_responder_mailer.rb +1 -1
  15. data/app/models/jobshop/auditing.rb +20 -0
  16. data/app/models/jobshop/collection.rb +2 -7
  17. data/app/models/jobshop/customer.rb +6 -17
  18. data/app/models/jobshop/customer/category.rb +2 -8
  19. data/app/models/jobshop/customer/contact.rb +3 -8
  20. data/app/models/jobshop/department.rb +10 -0
  21. data/app/models/jobshop/department/assignment.rb +15 -0
  22. data/app/models/jobshop/employee.rb +13 -6
  23. data/app/models/jobshop/employment.rb +8 -8
  24. data/app/models/jobshop/inspection.rb +1 -1
  25. data/app/models/jobshop/inspection/boolean_criterion.rb +13 -17
  26. data/app/models/jobshop/inspection/criterion.rb +9 -10
  27. data/app/models/jobshop/inspection/deviation_criterion.rb +10 -12
  28. data/app/models/jobshop/inspection/limit_criterion.rb +12 -10
  29. data/app/models/jobshop/inspection/report.rb +22 -34
  30. data/app/models/jobshop/mailman.rb +2 -4
  31. data/app/models/jobshop/order.rb +3 -27
  32. data/app/models/jobshop/order_line.rb +4 -10
  33. data/app/models/jobshop/organization.rb +8 -15
  34. data/app/models/jobshop/organization_state.rb +10 -0
  35. data/app/models/jobshop/place.rb +3 -8
  36. data/app/models/jobshop/product.rb +4 -7
  37. data/app/models/jobshop/rfq.rb +32 -14
  38. data/app/models/jobshop/rfq/line.rb +28 -0
  39. data/app/models/jobshop/rfq/line/assignment.rb +25 -0
  40. data/app/models/jobshop/rfq/line/quantity.rb +23 -0
  41. data/app/models/jobshop/role.rb +3 -9
  42. data/app/models/jobshop/role_assignment.rb +10 -4
  43. data/app/models/jobshop/routing_process.rb +4 -10
  44. data/app/models/jobshop/routing_step.rb +3 -5
  45. data/app/models/jobshop/thing.rb +3 -8
  46. data/app/models/jobshop/user.rb +24 -11
  47. data/app/views/jobshop/dashboards/show.html.haml +35 -0
  48. data/app/views/jobshop/departments/_form.html.haml +12 -0
  49. data/app/views/jobshop/departments/edit.html.haml +7 -0
  50. data/app/views/jobshop/departments/index.html.haml +17 -0
  51. data/app/views/jobshop/departments/new.html.haml +5 -0
  52. data/app/views/jobshop/departments/show.html.haml +15 -0
  53. data/app/views/jobshop/employees/_form.html.haml +46 -0
  54. data/app/views/jobshop/employees/edit.html.haml +1 -0
  55. data/app/views/jobshop/employees/index.html.haml +12 -0
  56. data/app/views/jobshop/employees/new.html.haml +1 -0
  57. data/app/views/jobshop/employees/show.html.haml +16 -0
  58. data/app/views/jobshop/organizations/_form.html.haml +10 -0
  59. data/app/views/jobshop/organizations/edit.html.haml +7 -0
  60. data/app/views/jobshop/organizations/index.html.haml +19 -0
  61. data/app/views/jobshop/organizations/new.html.haml +5 -0
  62. data/app/views/jobshop/organizations/show.html.haml +16 -0
  63. data/app/views/jobshop/rfqs/_form.html.haml +60 -0
  64. data/app/views/jobshop/rfqs/edit.html.haml +4 -0
  65. data/app/views/jobshop/rfqs/index.html.haml +2 -0
  66. data/app/views/jobshop/roles/_form.html.haml +11 -0
  67. data/app/views/jobshop/roles/edit.html.haml +7 -0
  68. data/app/views/jobshop/roles/index.html.haml +21 -0
  69. data/app/views/jobshop/roles/new.html.haml +5 -0
  70. data/app/views/jobshop/roles/show.html.haml +3 -0
  71. data/app/views/layouts/jobshop/application.html.haml +50 -2
  72. data/config/initializers/devise.rb +2 -2
  73. data/config/routes.rb +18 -0
  74. data/db/migrate/20170311194758_initialize_jobshop.rb +4 -39
  75. data/db/migrate/20171216021339_create_organizations.rb +3 -8
  76. data/db/migrate/20171216021350_create_users.rb +28 -0
  77. data/db/migrate/20171216021400_create_employees.rb +27 -9
  78. data/db/migrate/20171216021853_create_customers.rb +29 -14
  79. data/db/migrate/20171216022020_create_places.rb +3 -4
  80. data/db/migrate/20171216022135_create_products.rb +4 -4
  81. data/db/migrate/20171216022605_create_orders.rb +27 -13
  82. data/db/migrate/20171216023018_create_roles.rb +30 -27
  83. data/db/migrate/20171216035357_create_things.rb +26 -23
  84. data/db/migrate/20171219022118_create_routing_processes.rb +28 -33
  85. data/db/migrate/20180107203241_create_inspections.rb +48 -115
  86. data/db/migrate/20181117023949_create_rfqs.rb +74 -15
  87. data/db/migrate/20181118014603_create_mailmen.rb +5 -6
  88. data/db/migrate/20190309163306_create_departments.rb +38 -0
  89. data/db/migrate/support/temporal_tables.sql +210 -0
  90. data/db/seeds.rb +92 -64
  91. data/exe/jobshop +1 -0
  92. data/lib/generators/jobshop/app/app_generator.rb +13 -3
  93. data/lib/generators/jobshop/app/templates/Procfile.tt +1 -1
  94. data/lib/generators/jobshop/app/templates/config/databases/postgresql.yml.tt +24 -0
  95. data/lib/generators/jobshop/app/templates/config/puma.rb.tt +44 -0
  96. data/lib/generators/jobshop/canary/canary_generator.rb +21 -9
  97. data/lib/generators/jobshop/dev_cert/dev_cert_generator.rb +124 -0
  98. data/lib/jobshop.rb +1 -1
  99. data/lib/jobshop/cli.rb +3 -3
  100. data/lib/jobshop/cli/app_generator.rb +15 -10
  101. data/lib/jobshop/cli/application.rb +7 -7
  102. data/lib/jobshop/cli/base.rb +65 -0
  103. data/lib/jobshop/cli/canary.rb +120 -22
  104. data/lib/jobshop/configuration.rb +1 -1
  105. data/lib/jobshop/engine.rb +8 -4
  106. data/lib/jobshop/helpers/migration.rb +27 -66
  107. data/lib/jobshop/mailroom/base_handler.rb +1 -1
  108. data/lib/jobshop/mailroom/null_handler.rb +1 -1
  109. data/lib/jobshop/mailroom/postmaster.rb +1 -1
  110. data/lib/jobshop/mailroom/rfq_handler.rb +1 -1
  111. data/lib/jobshop/version.rb +2 -2
  112. data/lib/tasks/jobshop_tasks.rake +15 -1
  113. metadata +114 -61
  114. data/app/controllers/jobshop/organizations/lookups_controller.rb +0 -18
  115. data/app/models/jobshop/employment_version.rb +0 -10
  116. data/app/models/jobshop/inspection/result.rb +0 -46
  117. data/app/models/jobshop/inspection/tuple.rb +0 -17
  118. data/app/models/jobshop/rfq_line.rb +0 -12
  119. data/db/migrate/20171216021554_create_people.rb +0 -43
  120. data/lib/generators/jobshop/app/templates/config/database.yml.tt +0 -19
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "jobshop/helpers/migration.rb"
4
+
5
+ class CreateUsers < ActiveRecord::Migration[5.2]
6
+ include Jobshop::Helpers::Migration
7
+
8
+ def change
9
+ create_table_with_auditing :jobshop_users do |t|
10
+ t.references :organization, type: :uuid, null: false,
11
+ foreign_key: { to_table: :jobshop_organizations }
12
+
13
+ t.index %i[ organization_id id ], unique: true
14
+
15
+ t.citext :email, null: false
16
+
17
+ t.index %i[ organization_id email ], unique: true
18
+
19
+ t.string :encrypted_password, null: false, default: ""
20
+
21
+ t.string :reset_password_token, index: { unique: true }
22
+
23
+ t.datetime :reset_password_sent_at
24
+
25
+ t.timestamps
26
+ end
27
+ end
28
+ end
@@ -1,37 +1,55 @@
1
- # frozen_string_literals: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  require "jobshop/helpers/migration.rb"
4
4
 
5
5
  class CreateEmployees < ActiveRecord::Migration[5.2]
6
6
  include Jobshop::Helpers::Migration
7
7
 
8
- def change # rubocop:disable Metrics/MethodLength
8
+ def change
9
+ create_employees_table
10
+ create_employments_table
11
+ end
12
+
13
+ private def create_employees_table
9
14
  create_table_with_auditing :jobshop_employees, primary_key: %i[
10
- organization_id employee_id
15
+ organization_id id
11
16
  ] do |t|
17
+ t.references :user, type: :uuid, foreign_key: { to_table: :jobshop_users }
18
+
12
19
  t.citext :email, null: false
20
+
13
21
  t.string :forename
14
22
  t.string :surname
23
+
15
24
  t.timestamps
16
25
  end
17
26
 
18
27
  fk_organization :jobshop_employees
19
28
 
29
+ foreign_key :jobshop_employees, :jobshop_users,
30
+ { organization_id: :organization_id, user_id: :id }
31
+ end
32
+
33
+ private def create_employments_table
20
34
  create_table_with_auditing :jobshop_employments, primary_key: %i[
21
- organization_id employment_id
35
+ organization_id id
22
36
  ] do |t|
23
- t.uuid :employee_id
37
+ t.references :employee, type: :uuid, null: false,
38
+ foreign_key: { to_table: :jobshop_employees }
39
+
40
+ t.string :title, null: false, default: ""
41
+
24
42
  t.date :started_on, default: { expr: "('now'::text)::date" }
25
43
  t.date :ended_on
26
- t.string :title, null: false, default: ""
27
- t.datetime :updated_at, null: false
28
- t.uuid :updated_by_id
29
- t.datetime :deleted_at
44
+
30
45
  t.timestamps
31
46
  end
32
47
 
33
48
  fk_organization :jobshop_employments
34
49
 
50
+ foreign_key :jobshop_employments, :jobshop_employees,
51
+ { organization_id: :organization_id, employee_id: :id }
52
+
35
53
  execute <<~SQL
36
54
  ALTER TABLE
37
55
  jobshop_employments
@@ -1,4 +1,4 @@
1
- # frozen_string_literals: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  require "jobshop/helpers/migration.rb"
4
4
 
@@ -6,30 +6,40 @@ class CreateCustomers < ActiveRecord::Migration[5.2]
6
6
  include Jobshop::Helpers::Migration
7
7
 
8
8
  def change
9
+ create_customer_categories_table
10
+ create_customers_table
11
+ create_customer_contacts_table
12
+ end
13
+
14
+ private def create_customer_categories_table
9
15
  create_table_with_auditing :jobshop_customer_categories, primary_key: %i[
10
- organization_id category_id
16
+ organization_id id
11
17
  ] do |t|
12
18
  t.citext :name, null: false
19
+ t.index %i[ organization_id name ], unique: true
20
+
13
21
  t.text :description
14
22
  end
15
23
 
16
- add_index :jobshop_customer_categories, %i[ organization_id name ], unique: true
17
-
18
24
  fk_organization :jobshop_customer_categories
25
+ end
19
26
 
27
+ private def create_customers_table
20
28
  create_table_with_auditing :jobshop_customers, primary_key: %i[
21
- organization_id customer_id
29
+ organization_id id
22
30
  ] do |t|
23
31
  t.citext :name, null: false
24
- t.uuid :category_id, null: false
32
+ t.index %i[ organization_id name ], unique: true
33
+
34
+ t.references :category, type: :uuid, null: false, foreign_key:
35
+ { to_table: :jobshop_customer_categories }
36
+
25
37
  t.string :email_from_domain
38
+
26
39
  t.timestamps
27
40
  end
28
41
 
29
- add_index :jobshop_customers, %i[ organization_id name ], unique: true
30
-
31
- foreign_key :jobshop_customers, :jobshop_customer_categories,
32
- %i[ organization_id category_id ]
42
+ fk_organization :jobshop_customers
33
43
 
34
44
  # Reverse index on email_from_domain allows for search on just a domain
35
45
  # given the entire address.
@@ -39,19 +49,24 @@ class CreateCustomers < ActiveRecord::Migration[5.2]
39
49
  "organization_id, reverse(lower(email_from_domain)) text_pattern_ops",
40
50
  name: :idx_jobshop_customers_reverse_address, unique: true
41
51
 
42
- fk_organization :jobshop_customers
52
+ foreign_key :jobshop_customers, :jobshop_customer_categories,
53
+ { organization_id: :organization_id, category_id: :id }
54
+ end
43
55
 
56
+ private def create_customer_contacts_table
44
57
  create_table_with_auditing :jobshop_customer_contacts, primary_key: %i[
45
- organization_id customer_id contact_id
58
+ organization_id customer_id id
46
59
  ] do |t|
47
60
  t.citext :email, null: false
48
- t.string :surname
61
+ t.index %i[ organization_id email ], unique: true
62
+
49
63
  t.string :forename
64
+ t.string :surname
50
65
  end
51
66
 
52
67
  fk_organization :jobshop_customer_contacts
53
68
 
54
69
  foreign_key :jobshop_customer_contacts, :jobshop_customers,
55
- %i[ organization_id customer_id ]
70
+ { organization_id: :organization_id, customer_id: :id }
56
71
  end
57
72
  end
@@ -1,4 +1,4 @@
1
- # frozen_string_literals: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  require "jobshop/helpers/migration.rb"
4
4
 
@@ -7,15 +7,14 @@ class CreatePlaces < ActiveRecord::Migration[5.2]
7
7
 
8
8
  def change
9
9
  create_table_with_auditing :jobshop_places, primary_key: %i[
10
- organization_id place_id
10
+ organization_id id
11
11
  ]do |t|
12
12
  t.citext :name, null: false
13
+ t.index %i[ organization_id name ], unique: true
13
14
 
14
15
  t.timestamps
15
16
  end
16
17
 
17
- add_index :jobshop_places, %i[ organization_id name ], unique: true
18
-
19
18
  fk_organization :jobshop_places
20
19
  end
21
20
  end
@@ -1,4 +1,4 @@
1
- # frozen_string_literals: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  require "jobshop/helpers/migration.rb"
4
4
 
@@ -7,16 +7,16 @@ class CreateProducts < ActiveRecord::Migration[5.2]
7
7
 
8
8
  def change
9
9
  create_table_with_auditing :jobshop_products, primary_key: %i[
10
- organization_id product_id
10
+ organization_id id
11
11
  ] do |t|
12
12
  t.citext :name, null: false
13
+ t.index %i[ organization_id name ], unique: true
14
+
13
15
  t.text :description
14
16
 
15
17
  t.timestamps
16
18
  end
17
19
 
18
- add_index :jobshop_products, %i[ organization_id name ], unique: true
19
-
20
20
  fk_organization :jobshop_products
21
21
  end
22
22
  end
@@ -1,38 +1,52 @@
1
- # frozen_string_literals: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  require "jobshop/helpers/migration.rb"
4
4
 
5
5
  class CreateOrders < ActiveRecord::Migration[5.2]
6
6
  include Jobshop::Helpers::Migration
7
7
 
8
- def change # rubocop:disable Metrics/MethodLength
8
+ def change
9
+ create_orders_table
10
+ create_order_lines_table
11
+ end
12
+
13
+ private def create_orders_table
9
14
  create_table_with_auditing :jobshop_orders, primary_key: %i[
10
- organization_id order_id
15
+ organization_id id
11
16
  ] do |t|
12
- t.uuid :customer_id, null: false
17
+ t.references :customer, type: :uuid, null: false,
18
+ foreign_key: { to_table: :jobshop_customers }
19
+
13
20
  t.string :number
21
+ t.index %i[ organization_id number ], unique: true
22
+
14
23
  t.timestamps
15
24
  end
16
25
 
17
- add_index :jobshop_orders, %i[ organization_id number ], unique: true
18
- add_index :jobshop_orders, %i[ organization_id customer_id ],
19
- name: :idx_jobshop_orders_organization_customer
20
26
  fk_organization :jobshop_orders
27
+
21
28
  foreign_key :jobshop_orders, :jobshop_customers,
22
- %i[ organization_id customer_id ]
29
+ { organization_id: :organization_id, customer_id: :id }
30
+ end
23
31
 
32
+ private def create_order_lines_table
24
33
  create_table_with_auditing :jobshop_order_lines, primary_key: %i[
25
- organization_id order_id order_line_id
34
+ organization_id order_id id
26
35
  ] do |t|
27
- t.uuid :product_id, null: false
36
+ t.references :product, type: :uuid, null: false,
37
+ foreign_key: { to_table: :jobshop_products }
38
+
28
39
  t.timestamps
29
40
  end
30
41
 
31
- add_index :jobshop_order_lines, %i[ organization_id product_id ]
32
42
  fk_organization :jobshop_order_lines
43
+
44
+ add_index :jobshop_order_lines, %i[ organization_id product_id ]
45
+
33
46
  foreign_key :jobshop_order_lines, :jobshop_orders,
34
- %i[ organization_id order_id ]
47
+ { organization_id: :organization_id, order_id: :id }
48
+
35
49
  foreign_key :jobshop_order_lines, :jobshop_products,
36
- %i[ organization_id product_id ]
50
+ { organization_id: :organization_id, product_id: :id }
37
51
  end
38
52
  end
@@ -1,52 +1,55 @@
1
- # frozen_string_literals: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  require "jobshop/helpers/migration.rb"
4
4
 
5
5
  class CreateRoles < ActiveRecord::Migration[5.2]
6
6
  include Jobshop::Helpers::Migration
7
7
 
8
- def change # rubocop:disable Metrics/MethodLength
9
- create_table :jobshop_roles, id: false do |t|
10
- t.uuid :organization_id, null: false
11
- t.uuid :role_id, null: false, default: "gen_random_uuid()"
12
- t.index %i[ organization_id role_id ], unique: true,
13
- name: :idx_jobshop_roles_pkey
8
+ def change
9
+ create_roles_table
10
+ create_role_assignments_table
11
+ # create_abilities_table
12
+ end
14
13
 
14
+ private def create_roles_table
15
+ create_table_with_auditing :jobshop_roles, primary_key: %i[
16
+ organization_id id
17
+ ] do |t|
15
18
  t.citext :name
19
+
20
+ t.references :resource, polymorphic: true
21
+
16
22
  t.index %i[ organization_id name ], unique: true
23
+ t.index %i[ organization_id name resource_type resource_id ],
24
+ name: :idx_jobshop_roles_organization_name_type_id
17
25
 
18
26
  t.timestamps
19
27
  end
20
28
 
21
- idx_table_name_pkey :jobshop_roles
22
29
  fk_organization :jobshop_roles
30
+ end
23
31
 
24
- create_table :jobshop_role_assignments, id: false do |t|
25
- t.uuid :organization_id, null: false
26
- t.uuid :person_id, null: false
27
- t.uuid :role_id, null: false
28
-
29
- t.index %i[ organization_id person_id role_id ], unique: true,
30
- name: :jobshop_role_assignment_user_roles_ckey
31
- t.index %i[ organization_id role_id person_id ], unique: true,
32
- name: :jobshop_role_assignment_role_users_ckey
32
+ private def create_role_assignments_table
33
+ create_table_with_auditing :jobshop_role_assignments, primary_key: %i[
34
+ organization_id id
35
+ ] do |t|
36
+ t.references :user, type: :uuid, foreign_key: { to_table: :jobshop_users }
37
+ t.references :role, type: :uuid, foreign_key: { to_table: :jobshop_roles }
33
38
 
34
- t.timestamps
39
+ t.index %i[ organization_id user_id role_id ], unique: true,
40
+ name: :idx_jobshop_users_roles_organization_id_user_id_role_id
35
41
  end
36
42
 
37
43
  fk_organization :jobshop_role_assignments
44
+ end
38
45
 
39
- foreign_key :jobshop_role_assignments, :jobshop_roles,
40
- %i[ organization_id role_id ]
41
-
42
- foreign_key :jobshop_role_assignments, :jobshop_people,
43
- %i[ organization_id person_id ]
44
-
45
- create_table :jobshop_abilities, id: :uuid, default: "gen_random_uuid()" do |t|
46
- t.uuid :organization_id, null: false
47
- t.uuid :resource_id
46
+ private def create_abilities_table
47
+ create_table_with_auditing :jobshop_abilities, primary_key: %i[
48
+ organization_id id
49
+ ] do |t|
48
50
  t.string :resource_class, null: false
49
51
  t.integer :action
52
+ t.uuid :resource_id
50
53
  t.index %i[ organization_id resource_class action resource_id ],
51
54
  unique: true, name: :idx_jobshop_abilities_secondary_key
52
55
  end
@@ -1,4 +1,4 @@
1
- # frozen_string_literals: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  require "jobshop/helpers/migration.rb"
4
4
 
@@ -6,41 +6,44 @@ class CreateThings < ActiveRecord::Migration[5.2]
6
6
  include Jobshop::Helpers::Migration
7
7
 
8
8
  def change
9
- create_table :jobshop_things, id: false do |t|
10
- t.uuid :organization_id, null: false
11
- t.uuid :thing_id, null: false, default: "gen_random_uuid()"
12
- t.index %i[ organization_id thing_id ],
13
- name: :idx_jobshop_things_pkey, unique: true
9
+ create_collections_table
10
+ create_things_table
11
+ end
14
12
 
15
- t.uuid :collection_id, null: false
13
+ private def create_collections_table
14
+ create_table_with_auditing :jobshop_collections, primary_key: %i[
15
+ organization_id id
16
+ ] do |t|
16
17
  t.citext :name
17
- t.index %i[ organization_id collection_id name ], unique: true,
18
- name: :idx_jobshop_organization_id_collection_id_name
18
+ t.index %i[ organization_id name ], unique: true
19
19
 
20
- t.jsonb :custom_fields, null: false, default: "{}"
21
- t.index :custom_fields, using: :gin
20
+ t.jsonb :schema, null: false, default: "{}"
22
21
 
23
22
  t.timestamps
24
23
  end
25
24
 
26
- idx_table_name_pkey :jobshop_things
27
- fk_organization :jobshop_things
28
-
29
- create_table :jobshop_collections, id: false do |t|
30
- t.uuid :organization_id, null: false
31
- t.uuid :collection_id, null: false, default: "gen_random_uuid()"
32
- t.index %i[ organization_id collection_id ], unique: true,
33
- name: :idx_jobshop_collections_pkey
25
+ fk_organization :jobshop_collections
26
+ end
34
27
 
28
+ private def create_things_table
29
+ create_table_with_auditing :jobshop_things, primary_key: %i[
30
+ organization_id id
31
+ ]do |t|
32
+ t.references :collection, null: false, type: :uuid,
33
+ foreign_key: { to_table: :jobshop_collections }
35
34
  t.citext :name
36
- t.index %i[ organization_id name ], unique: true
35
+ t.index %i[ organization_id collection_id name ], unique: true,
36
+ name: :idx_jobshop_organization_id_collection_id_name
37
37
 
38
- t.jsonb :schema, null: false, default: "{}"
38
+ t.jsonb :custom_fields, null: false, default: "{}"
39
+ t.index :custom_fields, using: :gin
39
40
 
40
41
  t.timestamps
41
42
  end
42
43
 
43
- idx_table_name_pkey :jobshop_collections
44
- fk_organization :jobshop_collections
44
+ fk_organization :jobshop_things
45
+
46
+ foreign_key :jobshop_things, :jobshop_collections,
47
+ { organization_id: :organization_id, collection_id: :id }
45
48
  end
46
49
  end