Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Shopify/rails-bigint-primarykey

 
 

Repository files navigation

rails-bigint-primarykey Build Status

Overview

rails-bigint-primarykey aims to be a simple, transparent way to use 64bit primary keys in MySQL and PostgreSQL.

This gem was initially a fork of the rails-bigint-pk gem but it was significantly rewritten to support Rails 5.

Installation & Usage

Add the following to your Gemfile:

gem 'rails-bigint-primarykey'

Gotchas

When adding foreign key columns, be sure to use references and not add_column.

change_table :my_table do |t|
  t.references :other_table
end

# Doing this will not use 64bit ints
add_column :my_table, :other_table_id, :int

When upgrading to Rails 5.1 you still need this gem if your were using it before and your migrations still use the version 5.0 or previous.

About

Transparently use 64bit primary keys in rails.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 98.6%
  • Roff 1.4%