Created
July 20, 2011 21:25
-
-
Save typeoneerror/1095974 to your computer and use it in GitHub Desktop.
Hacking in bigint support for Mysql and Postgresql. Got a better method?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the rails application | |
require File.expand_path('../application', __FILE__) | |
require 'active_record/connection_adapters/mysql2_adapter' | |
require 'active_record/connection_adapters/postgresql_adapter' | |
ActiveRecord::ConnectionAdapters::Mysql2Adapter::NATIVE_DATABASE_TYPES[:big_primary_key] = "BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY".freeze | |
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:big_primary_key] = "bigserial primary key".freeze | |
# Initialize the rails application | |
Ou1::Application.initialize! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I try this solution, but when I run rake db:migrate, Error thourghed like this
I found rake task hasnot load the environment.rb file.
Am i do wrong?
Thx!