By default bin/rails action_text:install will generate migrations with integer primary keys for the record_id. If your parent model has a uuid primary key, you will likely end up with a PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_action_text_rich_texts_uniqueness" error after a few records are inserted.

The generated migrations have to be updated to set the record_id field to uuid.

In both ___create_active_storage_tables.active_storage.rb and ___create_action_text_tables.action_text migrations add type: :uuid to t.references :record:

t.references :record, null: false, polymorphic: true, index: false, type: :uuid