Sha256: 3009096efb16df5effcd148f9a7824dbad4f84f080e0388f1bb95a5cb693ecd2
Contents?: true
Size: 705 Bytes
Versions: 17
Compression:
Stored size: 705 Bytes
Contents
# frozen_string_literal: true class Create<%= model_name.camelize %>Events < ActiveRecord::Migration[7.0] def change create_table :<%= model_name.underscore %>_events do |t| # Change this to string if your aggregates primary key is a string type t.bigint :aggregate_id, null: false, index: true t.string :idempotency_key, null: true t.string :type, null: false t.json :data, null: false, default: {} t.json :metadata, null: false, default: {} t.timestamps t.index :idempotency_key, unique: true end # Enables optimistic locking on the evented table add_column :<%= model_name.underscore.pluralize %>, :lock_version, :integer end end
Version data entries
17 entries across 17 versions & 1 rubygems