Skip to content

Support custom primary key types in migration template #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bruno-costanzo
Copy link

FIXES #28

The only test I ran was configuring the PK in the Dummy APP, deleting the DB and all the migrations, and then reinstall the engine from scratch, which generated the correct migration:

class CreateRailsApiLoggerTable < ActiveRecord::Migration[8.0]
  def change
    create_table :inbound_request_logs, id: :uuid do |t|
      t.string :method
      t.string :path
      t.text :request_body
      t.text :response_body
      t.integer :response_code
      t.timestamp :started_at
      t.timestamp :ended_at
      t.references :loggable, index: true, polymorphic: true, type: :uuid
      t.timestamps null: false
    end

    create_table :outbound_request_logs, id: :uuid do |t|
      t.string :method
      t.string :path
      t.text :request_body
      t.text :response_body
      t.integer :response_code
      t.timestamp :started_at
      t.timestamp :ended_at
      t.references :loggable, index: true, polymorphic: true, type: :uuid
      t.timestamps null: false
    end
  end
end

@bruno-costanzo
Copy link
Author

I don't believe the failing tests are related.

@bruno-costanzo bruno-costanzo force-pushed the feature/handle-different-pk-configs branch from eaf36bf to 4d680d5 Compare July 21, 2025 07:09
@bruno-costanzo bruno-costanzo force-pushed the feature/handle-different-pk-configs branch from 4d680d5 to ca3faf7 Compare July 21, 2025 07:14
@bruno-costanzo bruno-costanzo self-assigned this Jul 21, 2025
@bruno-costanzo bruno-costanzo requested a review from coorasse July 21, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The migration templates don't take into account if the user has changed the behavior of the PK
1 participant