# frozen_string_literal: true class CreateLedgerTransactions < ActiveRecord::Migration[6.1] def change create_table <%= prefixed_table_name(:transactions) %> do |t| t.string :type t.string :transaction_id, null: false, index: { unique: true } t.string :description t.column :metadata, <%= json_column_type %> t.timestamp :occurred_at, null: false, default: -> { 'NOW()' } t.timestamps default: -> { 'NOW()' } end end end