[转]JSON Validation by Committee

https://www.sitepoint.com/json-validation-by-committee/

Advertisements

How to change integer to bigint for id by PostgreSQL with Rails

The default id will be integer data type in Rails.

This way can change the default data type to bigint when using PostgreSQL database:

 # railsapp/config/environment.rb

# Add below

ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:primary_key] = ‘bigserial primary key’