|
38 | 38 | t.string "other_column" |
39 | 39 | end |
40 | 40 |
|
41 | | - # Use uuid_generate_v7() for PostgreSQL, nil for SQLite (outbox tests require PostgreSQL) |
42 | | - id_default = if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL' |
43 | | - -> { "uuid_generate_v7()" } |
44 | | - else |
45 | | - nil |
46 | | - end |
47 | | - |
48 | | - create_table "journaled_outbox_events", id: :uuid, default: id_default, force: :cascade do |t| |
49 | | - t.string "event_type", null: false |
50 | | - t.text "event_data", null: false |
51 | | - t.string "partition_key", null: false |
52 | | - t.string "stream_name", null: false |
53 | | - t.text "failure_reason" |
54 | | - t.datetime "failed_at" |
55 | | - t.datetime "created_at", null: false, default: -> { "clock_timestamp()" } |
56 | | - t.index ["failed_at"], name: "index_journaled_outbox_events_on_failed_at" |
| 41 | + # Outbox events table is PostgreSQL-only (uses jsonb, timestamptz, uuid_generate_v7) |
| 42 | + if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL' |
| 43 | + create_table "journaled_outbox_events", id: :uuid, default: -> { "uuid_generate_v7()" }, force: :cascade do |t| |
| 44 | + t.string "event_type", null: false |
| 45 | + t.jsonb "event_data", null: false |
| 46 | + t.string "partition_key", null: false |
| 47 | + t.string "stream_name", null: false |
| 48 | + t.text "failure_reason" |
| 49 | + t.timestamptz "failed_at" |
| 50 | + t.timestamptz "created_at", null: false, default: -> { "clock_timestamp()" } |
| 51 | + t.index ["failed_at"], name: "index_journaled_outbox_events_on_failed_at" |
| 52 | + end |
57 | 53 | end |
58 | 54 | end |
0 commit comments