geneva_drive 0.8.0 → 0.9.0

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.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/MANUAL.md +215 -4
  4. data/README.md +14 -1
  5. data/Rakefile +14 -0
  6. data/bin/matrix +1 -1
  7. data/lib/generators/geneva_drive/install/templates/create_workflows_migration.rb +1 -1
  8. data/lib/generators/geneva_drive/install/templates/initializer.rb.tt +33 -2
  9. data/lib/geneva_drive/dispatchers/active_job_dispatcher.rb +33 -0
  10. data/lib/geneva_drive/dispatchers/sidekiq_dispatcher.rb +112 -0
  11. data/lib/geneva_drive/engine.rb +13 -0
  12. data/lib/geneva_drive/executor.rb +5 -3
  13. data/lib/geneva_drive/job_options.rb +7 -3
  14. data/lib/geneva_drive/jobs/perform_step_job.rb +2 -35
  15. data/lib/geneva_drive/jobs/sidekiq_housekeeping_job.rb +32 -0
  16. data/lib/geneva_drive/jobs/sidekiq_perform_step_job.rb +35 -0
  17. data/lib/geneva_drive/jobs/step_execution_lookup.rb +42 -0
  18. data/lib/geneva_drive/migration_helpers.rb +33 -3
  19. data/lib/geneva_drive/version.rb +1 -1
  20. data/lib/geneva_drive/workflow.rb +30 -37
  21. data/lib/geneva_drive.rb +63 -0
  22. data/test/dummy/config/initializers/geneva_drive.rb +35 -3
  23. data/test/dummy/db/mysql/schema-8.1.rb +95 -0
  24. data/test/dummy/db/postgres/schema-8.1.rb +99 -0
  25. data/test/dummy/db/sqlite/schema-7.2.rb +96 -0
  26. data/test/dummy/db/sqlite/schema-8.0.rb +96 -0
  27. data/test/dummy/db/sqlite/schema-8.1.rb +96 -0
  28. data/test/dummy/db/sqlite/test.sqlite3 +0 -0
  29. data/test/dummy/db/sqlite/test.sqlite3-0 +0 -0
  30. data/test/dummy/db/sqlite/test.sqlite3-1 +0 -0
  31. data/test/dummy/db/sqlite/test.sqlite3-2 +0 -0
  32. data/test/dummy/db/sqlite/test.sqlite3-3 +0 -0
  33. data/test/dummy/db/sqlite/test.sqlite3-4 +0 -0
  34. data/test/dummy/db/sqlite/test.sqlite3-5 +0 -0
  35. data/test/dummy/db/sqlite/test.sqlite3-6 +0 -0
  36. data/test/dummy/db/sqlite/test.sqlite3-7 +0 -0
  37. data/test/dummy/db/sqlite/test.sqlite3-8 +0 -0
  38. data/test/dummy/db/sqlite/test.sqlite3-9 +0 -0
  39. data/test/dummy/db/sqlite/test.sqlite3_0 +0 -0
  40. data/test/dummy/db/sqlite/test.sqlite3_1 +0 -0
  41. data/test/dummy/db/sqlite/test.sqlite3_2 +0 -0
  42. data/test/dummy/db/sqlite/test.sqlite3_3 +0 -0
  43. data/test/dummy/db/sqlite/test.sqlite3_4 +0 -0
  44. data/test/dummy/db/sqlite/test.sqlite3_5 +0 -0
  45. data/test/dummy/db/sqlite/test.sqlite3_6 +0 -0
  46. data/test/dummy/db/sqlite/test.sqlite3_7 +0 -0
  47. data/test/dummy/db/sqlite/test.sqlite3_8 +0 -0
  48. data/test/dummy/db/sqlite/test.sqlite3_9 +0 -0
  49. data/test/dummy/db/sqlite3/schema-7.2.rb +96 -0
  50. data/test/dummy/db/sqlite3/schema-8.1.rb +96 -0
  51. data/test/dummy/db/sqlite3/test.sqlite3 +0 -0
  52. data/test/dummy/db/sqlite3/test.sqlite3_0 +0 -0
  53. data/test/dummy/db/sqlite3/test.sqlite3_1 +0 -0
  54. data/test/dummy/db/sqlite3/test.sqlite3_2 +0 -0
  55. data/test/dummy/db/sqlite3/test.sqlite3_3 +0 -0
  56. data/test/dummy/db/sqlite3/test.sqlite3_4 +0 -0
  57. data/test/dummy/db/sqlite3/test.sqlite3_5 +0 -0
  58. data/test/dummy/db/sqlite3/test.sqlite3_6 +0 -0
  59. data/test/dummy/db/sqlite3/test.sqlite3_7 +0 -0
  60. data/test/dummy/db/sqlite3/test.sqlite3_8 +0 -0
  61. data/test/dummy/db/sqlite3/test.sqlite3_9 +0 -0
  62. data/test/generators/install_generator_test.rb +56 -0
  63. data/test/geneva_drive_test.rb +10 -0
  64. data/test/migration_helpers_test.rb +62 -0
  65. data/test/sidekiq/sidekiq_dispatcher_test.rb +322 -0
  66. data/test/sidekiq/sidekiq_redis_test.rb +115 -0
  67. data/test/workflow/pause_resume_test.rb +15 -0
  68. metadata +49 -2
@@ -0,0 +1,99 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[8.1].define(version: 2026_10_25_000614) do
14
+ # These are extensions that must be enabled in order to support this database
15
+ enable_extension "pg_catalog.plpgsql"
16
+
17
+ create_table "geneva_drive_signals", force: :cascade do |t|
18
+ t.bigint "workflow_id", null: false
19
+ t.string "name", null: false
20
+ t.string "idempotency_key"
21
+ t.string "state", default: "pending", null: false
22
+ t.jsonb "payload"
23
+ t.datetime "claimed_at"
24
+ t.datetime "consumed_at"
25
+ t.bigint "claimed", default: 0, null: false
26
+ t.bigint "consumed", default: 0, null: false
27
+ t.datetime "created_at", null: false
28
+ t.datetime "updated_at", null: false
29
+ t.index ["workflow_id", "name", "idempotency_key"], name: "index_geneva_drive_signals_dedup", unique: true
30
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_signals_on_workflow_id_and_state"
31
+ t.index ["workflow_id"], name: "index_geneva_drive_signals_on_workflow_id"
32
+ end
33
+
34
+ create_table "geneva_drive_step_executions", force: :cascade do |t|
35
+ t.bigint "workflow_id", null: false
36
+ t.string "step_name", null: false
37
+ t.string "state", default: "scheduled", null: false
38
+ t.string "outcome"
39
+ t.datetime "scheduled_for", null: false
40
+ t.datetime "started_at"
41
+ t.datetime "completed_at"
42
+ t.datetime "failed_at"
43
+ t.datetime "canceled_at"
44
+ t.datetime "skipped_at"
45
+ t.string "error_class_name"
46
+ t.text "error_message"
47
+ t.text "error_backtrace"
48
+ t.string "job_id"
49
+ t.jsonb "metadata"
50
+ t.datetime "created_at", null: false
51
+ t.datetime "updated_at", null: false
52
+ t.datetime "finished_at"
53
+ t.jsonb "cursor"
54
+ t.bigint "continues_from_id"
55
+ t.bigint "signal_id"
56
+ t.datetime "waiting_since"
57
+ t.index ["continues_from_id"], name: "index_geneva_drive_step_executions_on_continues_from_id"
58
+ t.index ["finished_at"], name: "index_geneva_drive_step_executions_on_finished_at"
59
+ t.index ["scheduled_for"], name: "index_geneva_drive_step_executions_on_scheduled_for"
60
+ t.index ["signal_id"], name: "index_geneva_drive_step_executions_on_signal_id"
61
+ t.index ["started_at"], name: "index_geneva_drive_step_executions_in_progress_started_at", where: "((state)::text = 'in_progress'::text)"
62
+ t.index ["state", "scheduled_for"], name: "index_geneva_drive_step_executions_scheduled"
63
+ t.index ["state"], name: "index_geneva_drive_step_executions_on_state"
64
+ t.index ["workflow_id", "created_at"], name: "idx_on_workflow_id_created_at_af16a14fb2"
65
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_step_executions_on_workflow_id_and_state"
66
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_on_workflow_id"
67
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_one_active", unique: true, where: "((state)::text = ANY ((ARRAY['scheduled'::character varying, 'in_progress'::character varying])::text[]))"
68
+ end
69
+
70
+ create_table "geneva_drive_workflows", force: :cascade do |t|
71
+ t.string "type", null: false
72
+ t.string "hero_type"
73
+ t.bigint "hero_id"
74
+ t.string "state", default: "ready", null: false
75
+ t.string "current_step_name"
76
+ t.string "next_step_name"
77
+ t.boolean "allow_multiple", default: false, null: false
78
+ t.jsonb "metadata"
79
+ t.datetime "started_at"
80
+ t.datetime "transitioned_at"
81
+ t.datetime "created_at", null: false
82
+ t.datetime "updated_at", null: false
83
+ t.index ["hero_type", "hero_id"], name: "index_geneva_drive_workflows_on_hero_type_and_hero_id"
84
+ t.index ["state"], name: "index_geneva_drive_workflows_on_state"
85
+ t.index ["type", "hero_type", "hero_id"], name: "index_geneva_drive_workflows_unique_ongoing", unique: true, where: "(((state)::text <> ALL ((ARRAY['finished'::character varying, 'canceled'::character varying])::text[])) AND (allow_multiple = false))"
86
+ t.index ["type"], name: "index_geneva_drive_workflows_on_type"
87
+ end
88
+
89
+ create_table "users", force: :cascade do |t|
90
+ t.string "email", null: false
91
+ t.string "name"
92
+ t.boolean "active", default: true
93
+ t.datetime "created_at", null: false
94
+ t.datetime "updated_at", null: false
95
+ end
96
+
97
+ add_foreign_key "geneva_drive_signals", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
98
+ add_foreign_key "geneva_drive_step_executions", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
99
+ end
@@ -0,0 +1,96 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[7.2].define(version: 2026_10_25_090462) do
14
+ create_table "geneva_drive_signals", force: :cascade do |t|
15
+ t.integer "workflow_id", null: false
16
+ t.string "name", null: false
17
+ t.string "idempotency_key"
18
+ t.string "state", default: "pending", null: false
19
+ t.json "payload"
20
+ t.datetime "claimed_at"
21
+ t.datetime "consumed_at"
22
+ t.bigint "claimed", default: 0, null: false
23
+ t.bigint "consumed", default: 0, null: false
24
+ t.datetime "created_at", null: false
25
+ t.datetime "updated_at", null: false
26
+ t.index ["workflow_id", "name", "idempotency_key"], name: "index_geneva_drive_signals_dedup", unique: true
27
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_signals_on_workflow_id_and_state"
28
+ t.index ["workflow_id"], name: "index_geneva_drive_signals_on_workflow_id"
29
+ end
30
+
31
+ create_table "geneva_drive_step_executions", force: :cascade do |t|
32
+ t.integer "workflow_id", null: false
33
+ t.string "step_name", null: false
34
+ t.string "state", default: "scheduled", null: false
35
+ t.string "outcome"
36
+ t.datetime "scheduled_for", null: false
37
+ t.datetime "started_at"
38
+ t.datetime "completed_at"
39
+ t.datetime "failed_at"
40
+ t.datetime "canceled_at"
41
+ t.datetime "skipped_at"
42
+ t.string "error_class_name"
43
+ t.text "error_message"
44
+ t.text "error_backtrace"
45
+ t.string "job_id"
46
+ t.text "metadata"
47
+ t.datetime "created_at", null: false
48
+ t.datetime "updated_at", null: false
49
+ t.datetime "finished_at"
50
+ t.json "cursor"
51
+ t.bigint "continues_from_id"
52
+ t.bigint "signal_id"
53
+ t.datetime "waiting_since"
54
+ t.index ["continues_from_id"], name: "index_geneva_drive_step_executions_on_continues_from_id"
55
+ t.index ["finished_at"], name: "index_geneva_drive_step_executions_on_finished_at"
56
+ t.index ["scheduled_for"], name: "index_geneva_drive_step_executions_on_scheduled_for"
57
+ t.index ["signal_id"], name: "index_geneva_drive_step_executions_on_signal_id"
58
+ t.index ["started_at"], name: "index_geneva_drive_step_executions_in_progress_started_at", where: "state = 'in_progress'"
59
+ t.index ["state", "scheduled_for"], name: "index_geneva_drive_step_executions_scheduled"
60
+ t.index ["state"], name: "index_geneva_drive_step_executions_on_state"
61
+ t.index ["workflow_id", "created_at"], name: "idx_on_workflow_id_created_at_af16a14fb2"
62
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_step_executions_on_workflow_id_and_state"
63
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_on_workflow_id"
64
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_one_active", unique: true, where: "state IN ('scheduled', 'in_progress')"
65
+ end
66
+
67
+ create_table "geneva_drive_workflows", force: :cascade do |t|
68
+ t.string "type", null: false
69
+ t.string "hero_type"
70
+ t.integer "hero_id"
71
+ t.string "state", default: "ready", null: false
72
+ t.string "current_step_name"
73
+ t.string "next_step_name"
74
+ t.boolean "allow_multiple", default: false, null: false
75
+ t.text "metadata"
76
+ t.datetime "started_at"
77
+ t.datetime "transitioned_at"
78
+ t.datetime "created_at", null: false
79
+ t.datetime "updated_at", null: false
80
+ t.index ["hero_type", "hero_id"], name: "index_geneva_drive_workflows_on_hero_type_and_hero_id"
81
+ t.index ["state"], name: "index_geneva_drive_workflows_on_state"
82
+ t.index ["type", "hero_type", "hero_id"], name: "index_geneva_drive_workflows_unique_ongoing", unique: true, where: "state NOT IN ('finished', 'canceled') AND allow_multiple = 0"
83
+ t.index ["type"], name: "index_geneva_drive_workflows_on_type"
84
+ end
85
+
86
+ create_table "users", force: :cascade do |t|
87
+ t.string "email", null: false
88
+ t.string "name"
89
+ t.boolean "active", default: true
90
+ t.datetime "created_at", null: false
91
+ t.datetime "updated_at", null: false
92
+ end
93
+
94
+ add_foreign_key "geneva_drive_signals", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
95
+ add_foreign_key "geneva_drive_step_executions", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
96
+ end
@@ -0,0 +1,96 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[8.0].define(version: 2026_10_25_000614) do
14
+ create_table "geneva_drive_signals", force: :cascade do |t|
15
+ t.integer "workflow_id", null: false
16
+ t.string "name", null: false
17
+ t.string "idempotency_key"
18
+ t.string "state", default: "pending", null: false
19
+ t.json "payload"
20
+ t.datetime "claimed_at"
21
+ t.datetime "consumed_at"
22
+ t.bigint "claimed", default: 0, null: false
23
+ t.bigint "consumed", default: 0, null: false
24
+ t.datetime "created_at", null: false
25
+ t.datetime "updated_at", null: false
26
+ t.index ["workflow_id", "name", "idempotency_key"], name: "index_geneva_drive_signals_dedup", unique: true
27
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_signals_on_workflow_id_and_state"
28
+ t.index ["workflow_id"], name: "index_geneva_drive_signals_on_workflow_id"
29
+ end
30
+
31
+ create_table "geneva_drive_step_executions", force: :cascade do |t|
32
+ t.integer "workflow_id", null: false
33
+ t.string "step_name", null: false
34
+ t.string "state", default: "scheduled", null: false
35
+ t.string "outcome"
36
+ t.datetime "scheduled_for", null: false
37
+ t.datetime "started_at"
38
+ t.datetime "completed_at"
39
+ t.datetime "failed_at"
40
+ t.datetime "canceled_at"
41
+ t.datetime "skipped_at"
42
+ t.string "error_class_name"
43
+ t.text "error_message"
44
+ t.text "error_backtrace"
45
+ t.string "job_id"
46
+ t.text "metadata"
47
+ t.datetime "created_at", null: false
48
+ t.datetime "updated_at", null: false
49
+ t.datetime "finished_at"
50
+ t.json "cursor"
51
+ t.bigint "continues_from_id"
52
+ t.bigint "signal_id"
53
+ t.datetime "waiting_since"
54
+ t.index ["continues_from_id"], name: "index_geneva_drive_step_executions_on_continues_from_id"
55
+ t.index ["finished_at"], name: "index_geneva_drive_step_executions_on_finished_at"
56
+ t.index ["scheduled_for"], name: "index_geneva_drive_step_executions_on_scheduled_for"
57
+ t.index ["signal_id"], name: "index_geneva_drive_step_executions_on_signal_id"
58
+ t.index ["started_at"], name: "index_geneva_drive_step_executions_in_progress_started_at", where: "state = 'in_progress'"
59
+ t.index ["state", "scheduled_for"], name: "index_geneva_drive_step_executions_scheduled"
60
+ t.index ["state"], name: "index_geneva_drive_step_executions_on_state"
61
+ t.index ["workflow_id", "created_at"], name: "idx_on_workflow_id_created_at_af16a14fb2"
62
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_step_executions_on_workflow_id_and_state"
63
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_on_workflow_id"
64
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_one_active", unique: true, where: "state IN ('scheduled', 'in_progress')"
65
+ end
66
+
67
+ create_table "geneva_drive_workflows", force: :cascade do |t|
68
+ t.string "type", null: false
69
+ t.string "hero_type"
70
+ t.integer "hero_id"
71
+ t.string "state", default: "ready", null: false
72
+ t.string "current_step_name"
73
+ t.string "next_step_name"
74
+ t.boolean "allow_multiple", default: false, null: false
75
+ t.text "metadata"
76
+ t.datetime "started_at"
77
+ t.datetime "transitioned_at"
78
+ t.datetime "created_at", null: false
79
+ t.datetime "updated_at", null: false
80
+ t.index ["hero_type", "hero_id"], name: "index_geneva_drive_workflows_on_hero_type_and_hero_id"
81
+ t.index ["state"], name: "index_geneva_drive_workflows_on_state"
82
+ t.index ["type", "hero_type", "hero_id"], name: "index_geneva_drive_workflows_unique_ongoing", unique: true, where: "state NOT IN ('finished', 'canceled') AND allow_multiple = 0"
83
+ t.index ["type"], name: "index_geneva_drive_workflows_on_type"
84
+ end
85
+
86
+ create_table "users", force: :cascade do |t|
87
+ t.string "email", null: false
88
+ t.string "name"
89
+ t.boolean "active", default: true
90
+ t.datetime "created_at", null: false
91
+ t.datetime "updated_at", null: false
92
+ end
93
+
94
+ add_foreign_key "geneva_drive_signals", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
95
+ add_foreign_key "geneva_drive_step_executions", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
96
+ end
@@ -0,0 +1,96 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[8.1].define(version: 2026_10_25_000614) do
14
+ create_table "geneva_drive_signals", force: :cascade do |t|
15
+ t.integer "workflow_id", null: false
16
+ t.string "name", null: false
17
+ t.string "idempotency_key"
18
+ t.string "state", default: "pending", null: false
19
+ t.json "payload"
20
+ t.datetime "claimed_at"
21
+ t.datetime "consumed_at"
22
+ t.bigint "claimed", default: 0, null: false
23
+ t.bigint "consumed", default: 0, null: false
24
+ t.datetime "created_at", null: false
25
+ t.datetime "updated_at", null: false
26
+ t.index ["workflow_id", "name", "idempotency_key"], name: "index_geneva_drive_signals_dedup", unique: true
27
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_signals_on_workflow_id_and_state"
28
+ t.index ["workflow_id"], name: "index_geneva_drive_signals_on_workflow_id"
29
+ end
30
+
31
+ create_table "geneva_drive_step_executions", force: :cascade do |t|
32
+ t.integer "workflow_id", null: false
33
+ t.string "step_name", null: false
34
+ t.string "state", default: "scheduled", null: false
35
+ t.string "outcome"
36
+ t.datetime "scheduled_for", null: false
37
+ t.datetime "started_at"
38
+ t.datetime "completed_at"
39
+ t.datetime "failed_at"
40
+ t.datetime "canceled_at"
41
+ t.datetime "skipped_at"
42
+ t.string "error_class_name"
43
+ t.text "error_message"
44
+ t.text "error_backtrace"
45
+ t.string "job_id"
46
+ t.text "metadata"
47
+ t.datetime "created_at", null: false
48
+ t.datetime "updated_at", null: false
49
+ t.datetime "finished_at"
50
+ t.json "cursor"
51
+ t.bigint "continues_from_id"
52
+ t.bigint "signal_id"
53
+ t.datetime "waiting_since"
54
+ t.index ["continues_from_id"], name: "index_geneva_drive_step_executions_on_continues_from_id"
55
+ t.index ["finished_at"], name: "index_geneva_drive_step_executions_on_finished_at"
56
+ t.index ["scheduled_for"], name: "index_geneva_drive_step_executions_on_scheduled_for"
57
+ t.index ["signal_id"], name: "index_geneva_drive_step_executions_on_signal_id"
58
+ t.index ["started_at"], name: "index_geneva_drive_step_executions_in_progress_started_at", where: "state = 'in_progress'"
59
+ t.index ["state", "scheduled_for"], name: "index_geneva_drive_step_executions_scheduled"
60
+ t.index ["state"], name: "index_geneva_drive_step_executions_on_state"
61
+ t.index ["workflow_id", "created_at"], name: "idx_on_workflow_id_created_at_af16a14fb2"
62
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_step_executions_on_workflow_id_and_state"
63
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_on_workflow_id"
64
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_one_active", unique: true, where: "state IN ('scheduled', 'in_progress')"
65
+ end
66
+
67
+ create_table "geneva_drive_workflows", force: :cascade do |t|
68
+ t.string "type", null: false
69
+ t.string "hero_type"
70
+ t.integer "hero_id"
71
+ t.string "state", default: "ready", null: false
72
+ t.string "current_step_name"
73
+ t.string "next_step_name"
74
+ t.boolean "allow_multiple", default: false, null: false
75
+ t.text "metadata"
76
+ t.datetime "started_at"
77
+ t.datetime "transitioned_at"
78
+ t.datetime "created_at", null: false
79
+ t.datetime "updated_at", null: false
80
+ t.index ["hero_type", "hero_id"], name: "index_geneva_drive_workflows_on_hero_type_and_hero_id"
81
+ t.index ["state"], name: "index_geneva_drive_workflows_on_state"
82
+ t.index ["type", "hero_type", "hero_id"], name: "index_geneva_drive_workflows_unique_ongoing", unique: true, where: "state NOT IN ('finished', 'canceled') AND allow_multiple = 0"
83
+ t.index ["type"], name: "index_geneva_drive_workflows_on_type"
84
+ end
85
+
86
+ create_table "users", force: :cascade do |t|
87
+ t.string "email", null: false
88
+ t.string "name"
89
+ t.boolean "active", default: true
90
+ t.datetime "created_at", null: false
91
+ t.datetime "updated_at", null: false
92
+ end
93
+
94
+ add_foreign_key "geneva_drive_signals", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
95
+ add_foreign_key "geneva_drive_step_executions", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
96
+ end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,96 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[7.2].define(version: 2026_10_25_090462) do
14
+ create_table "geneva_drive_signals", force: :cascade do |t|
15
+ t.integer "workflow_id", null: false
16
+ t.string "name", null: false
17
+ t.string "idempotency_key"
18
+ t.string "state", default: "pending", null: false
19
+ t.json "payload"
20
+ t.datetime "claimed_at"
21
+ t.datetime "consumed_at"
22
+ t.bigint "claimed", default: 0, null: false
23
+ t.bigint "consumed", default: 0, null: false
24
+ t.datetime "created_at", null: false
25
+ t.datetime "updated_at", null: false
26
+ t.index ["workflow_id", "name", "idempotency_key"], name: "index_geneva_drive_signals_dedup", unique: true
27
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_signals_on_workflow_id_and_state"
28
+ t.index ["workflow_id"], name: "index_geneva_drive_signals_on_workflow_id"
29
+ end
30
+
31
+ create_table "geneva_drive_step_executions", force: :cascade do |t|
32
+ t.integer "workflow_id", null: false
33
+ t.string "step_name", null: false
34
+ t.string "state", default: "scheduled", null: false
35
+ t.string "outcome"
36
+ t.datetime "scheduled_for", null: false
37
+ t.datetime "started_at"
38
+ t.datetime "completed_at"
39
+ t.datetime "failed_at"
40
+ t.datetime "canceled_at"
41
+ t.datetime "skipped_at"
42
+ t.string "error_class_name"
43
+ t.text "error_message"
44
+ t.text "error_backtrace"
45
+ t.string "job_id"
46
+ t.text "metadata"
47
+ t.datetime "created_at", null: false
48
+ t.datetime "updated_at", null: false
49
+ t.datetime "finished_at"
50
+ t.json "cursor"
51
+ t.bigint "continues_from_id"
52
+ t.bigint "signal_id"
53
+ t.datetime "waiting_since"
54
+ t.index ["continues_from_id"], name: "index_geneva_drive_step_executions_on_continues_from_id"
55
+ t.index ["finished_at"], name: "index_geneva_drive_step_executions_on_finished_at"
56
+ t.index ["scheduled_for"], name: "index_geneva_drive_step_executions_on_scheduled_for"
57
+ t.index ["signal_id"], name: "index_geneva_drive_step_executions_on_signal_id"
58
+ t.index ["started_at"], name: "index_geneva_drive_step_executions_in_progress_started_at", where: "state = 'in_progress'"
59
+ t.index ["state", "scheduled_for"], name: "index_geneva_drive_step_executions_scheduled"
60
+ t.index ["state"], name: "index_geneva_drive_step_executions_on_state"
61
+ t.index ["workflow_id", "created_at"], name: "idx_on_workflow_id_created_at_af16a14fb2"
62
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_step_executions_on_workflow_id_and_state"
63
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_on_workflow_id"
64
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_one_active", unique: true, where: "state IN ('scheduled', 'in_progress')"
65
+ end
66
+
67
+ create_table "geneva_drive_workflows", force: :cascade do |t|
68
+ t.string "type", null: false
69
+ t.string "hero_type"
70
+ t.integer "hero_id"
71
+ t.string "state", default: "ready", null: false
72
+ t.string "current_step_name"
73
+ t.string "next_step_name"
74
+ t.boolean "allow_multiple", default: false, null: false
75
+ t.text "metadata"
76
+ t.datetime "started_at"
77
+ t.datetime "transitioned_at"
78
+ t.datetime "created_at", null: false
79
+ t.datetime "updated_at", null: false
80
+ t.index ["hero_type", "hero_id"], name: "index_geneva_drive_workflows_on_hero_type_and_hero_id"
81
+ t.index ["state"], name: "index_geneva_drive_workflows_on_state"
82
+ t.index ["type", "hero_type", "hero_id"], name: "index_geneva_drive_workflows_unique_ongoing", unique: true, where: "state NOT IN ('finished', 'canceled') AND allow_multiple = 0"
83
+ t.index ["type"], name: "index_geneva_drive_workflows_on_type"
84
+ end
85
+
86
+ create_table "users", force: :cascade do |t|
87
+ t.string "email", null: false
88
+ t.string "name"
89
+ t.boolean "active", default: true
90
+ t.datetime "created_at", null: false
91
+ t.datetime "updated_at", null: false
92
+ end
93
+
94
+ add_foreign_key "geneva_drive_signals", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
95
+ add_foreign_key "geneva_drive_step_executions", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
96
+ end
@@ -0,0 +1,96 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[8.1].define(version: 2026_10_25_090462) do
14
+ create_table "geneva_drive_signals", force: :cascade do |t|
15
+ t.integer "workflow_id", null: false
16
+ t.string "name", null: false
17
+ t.string "idempotency_key"
18
+ t.string "state", default: "pending", null: false
19
+ t.json "payload"
20
+ t.datetime "claimed_at"
21
+ t.datetime "consumed_at"
22
+ t.bigint "claimed", default: 0, null: false
23
+ t.bigint "consumed", default: 0, null: false
24
+ t.datetime "created_at", null: false
25
+ t.datetime "updated_at", null: false
26
+ t.index ["workflow_id", "name", "idempotency_key"], name: "index_geneva_drive_signals_dedup", unique: true
27
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_signals_on_workflow_id_and_state"
28
+ t.index ["workflow_id"], name: "index_geneva_drive_signals_on_workflow_id"
29
+ end
30
+
31
+ create_table "geneva_drive_step_executions", force: :cascade do |t|
32
+ t.integer "workflow_id", null: false
33
+ t.string "step_name", null: false
34
+ t.string "state", default: "scheduled", null: false
35
+ t.string "outcome"
36
+ t.datetime "scheduled_for", null: false
37
+ t.datetime "started_at"
38
+ t.datetime "completed_at"
39
+ t.datetime "failed_at"
40
+ t.datetime "canceled_at"
41
+ t.datetime "skipped_at"
42
+ t.string "error_class_name"
43
+ t.text "error_message"
44
+ t.text "error_backtrace"
45
+ t.string "job_id"
46
+ t.text "metadata"
47
+ t.datetime "created_at", null: false
48
+ t.datetime "updated_at", null: false
49
+ t.datetime "finished_at"
50
+ t.json "cursor"
51
+ t.bigint "continues_from_id"
52
+ t.bigint "signal_id"
53
+ t.datetime "waiting_since"
54
+ t.index ["continues_from_id"], name: "index_geneva_drive_step_executions_on_continues_from_id"
55
+ t.index ["finished_at"], name: "index_geneva_drive_step_executions_on_finished_at"
56
+ t.index ["scheduled_for"], name: "index_geneva_drive_step_executions_on_scheduled_for"
57
+ t.index ["signal_id"], name: "index_geneva_drive_step_executions_on_signal_id"
58
+ t.index ["started_at"], name: "index_geneva_drive_step_executions_in_progress_started_at", where: "state = 'in_progress'"
59
+ t.index ["state", "scheduled_for"], name: "index_geneva_drive_step_executions_scheduled"
60
+ t.index ["state"], name: "index_geneva_drive_step_executions_on_state"
61
+ t.index ["workflow_id", "created_at"], name: "idx_on_workflow_id_created_at_af16a14fb2"
62
+ t.index ["workflow_id", "state"], name: "index_geneva_drive_step_executions_on_workflow_id_and_state"
63
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_on_workflow_id"
64
+ t.index ["workflow_id"], name: "index_geneva_drive_step_executions_one_active", unique: true, where: "state IN ('scheduled', 'in_progress')"
65
+ end
66
+
67
+ create_table "geneva_drive_workflows", force: :cascade do |t|
68
+ t.string "type", null: false
69
+ t.string "hero_type"
70
+ t.integer "hero_id"
71
+ t.string "state", default: "ready", null: false
72
+ t.string "current_step_name"
73
+ t.string "next_step_name"
74
+ t.boolean "allow_multiple", default: false, null: false
75
+ t.text "metadata"
76
+ t.datetime "started_at"
77
+ t.datetime "transitioned_at"
78
+ t.datetime "created_at", null: false
79
+ t.datetime "updated_at", null: false
80
+ t.index ["hero_type", "hero_id"], name: "index_geneva_drive_workflows_on_hero_type_and_hero_id"
81
+ t.index ["state"], name: "index_geneva_drive_workflows_on_state"
82
+ t.index ["type", "hero_type", "hero_id"], name: "index_geneva_drive_workflows_unique_ongoing", unique: true, where: "state NOT IN ('finished', 'canceled') AND allow_multiple = 0"
83
+ t.index ["type"], name: "index_geneva_drive_workflows_on_type"
84
+ end
85
+
86
+ create_table "users", force: :cascade do |t|
87
+ t.string "email", null: false
88
+ t.string "name"
89
+ t.boolean "active", default: true
90
+ t.datetime "created_at", null: false
91
+ t.datetime "updated_at", null: false
92
+ end
93
+
94
+ add_foreign_key "geneva_drive_signals", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
95
+ add_foreign_key "geneva_drive_step_executions", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
96
+ end
Binary file