geneva_drive 0.3.0 → 0.4.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.
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddResumableStepSupportToGenevaDriveStepExecutions < ActiveRecord::Migration[7.2]
4
+ def change
5
+ # Add cursor column for resumable steps to track iteration progress.
6
+ # Uses database-native JSON type:
7
+ # - PostgreSQL: jsonb (indexed, efficient, supports containment queries)
8
+ # - MySQL 5.7+: json (native validation and storage)
9
+ # - SQLite: json (Rails handles as TEXT with serialization)
10
+ adapter = connection.adapter_name.downcase
11
+ if adapter.include?("postgresql")
12
+ add_column :geneva_drive_step_executions, :cursor, :jsonb
13
+ else
14
+ add_column :geneva_drive_step_executions, :cursor, :json
15
+ end
16
+
17
+ # Add continues_from_id to link chained step executions.
18
+ # When a resumable step pauses and resumes, a new execution is created
19
+ # that continues from where the previous one left off.
20
+ add_column :geneva_drive_step_executions, :continues_from_id, :bigint
21
+ add_index :geneva_drive_step_executions, :continues_from_id
22
+ add_foreign_key :geneva_drive_step_executions, :geneva_drive_step_executions,
23
+ column: :continues_from_id, on_delete: :nullify
24
+ end
25
+ end
@@ -10,14 +10,16 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema[8.1].define(version: 2026_01_26_164028) do
13
+ ActiveRecord::Schema[8.1].define(version: 2026_01_28_104742) do
14
14
  # These are extensions that must be enabled in order to support this database
15
15
  enable_extension "pg_catalog.plpgsql"
16
16
 
17
17
  create_table "geneva_drive_step_executions", force: :cascade do |t|
18
18
  t.datetime "canceled_at"
19
19
  t.datetime "completed_at"
20
+ t.bigint "continues_from_id"
20
21
  t.datetime "created_at", null: false
22
+ t.jsonb "cursor"
21
23
  t.text "error_backtrace"
22
24
  t.string "error_class_name"
23
25
  t.text "error_message"
@@ -32,6 +34,7 @@ ActiveRecord::Schema[8.1].define(version: 2026_01_26_164028) do
32
34
  t.string "step_name", null: false
33
35
  t.datetime "updated_at", null: false
34
36
  t.bigint "workflow_id", null: false
37
+ t.index ["continues_from_id"], name: "index_geneva_drive_step_executions_on_continues_from_id"
35
38
  t.index ["finished_at"], name: "index_geneva_drive_step_executions_on_finished_at"
36
39
  t.index ["scheduled_for"], name: "index_geneva_drive_step_executions_on_scheduled_for"
37
40
  t.index ["state", "scheduled_for"], name: "index_geneva_drive_step_executions_scheduled"
@@ -68,5 +71,6 @@ ActiveRecord::Schema[8.1].define(version: 2026_01_26_164028) do
68
71
  t.datetime "updated_at", null: false
69
72
  end
70
73
 
74
+ add_foreign_key "geneva_drive_step_executions", "geneva_drive_step_executions", column: "continues_from_id", on_delete: :nullify
71
75
  add_foreign_key "geneva_drive_step_executions", "geneva_drive_workflows", column: "workflow_id", on_delete: :cascade
72
76
  end