Skip to content

How to add uuid primary key column to the existing table in migration script #61

@phanhongphucit

Description

@phanhongphucit

Hi,

For the normal id key (int(11)) we can use the following command:

   class AddIdToProducts < ActiveRecord::Migration
       def change
           add_column :products, :id, :primary_key
       end
   end

How can we do it for uuid primary key?

Best

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions