Created
February 14, 2011 13:20
-
-
Save chrisroos/825859 to your computer and use it in GitHub Desktop.
A test of whether the ActiveRecord ruby schema format supports bigints
This file contains 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
# Create a table in a migration, testing both :integer with a limit of 8, and a :bigint | |
create_table :people, :force => true do |t| | |
t.column :col_1, :integer, :limit => 8 | |
t.column :col_2, :bigint | |
t.column :col_3, :integer | |
end |
This file contains 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
# This is the table represented by the ruby schema format. | |
create_table "people", :force => true do |t| | |
t.integer "col_1", :limit => 8 | |
t.integer "col_2", :limit => 8 | |
t.integer "col_3" | |
end |
This file contains 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
# This is the table represented in the sql format. You can see that both col_1 and col_2 have been created as bigints. | |
CREATE TABLE `people` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`col_1` bigint(20) DEFAULT NULL, | |
`col_2` bigint(20) DEFAULT NULL, | |
`col_3` int(11) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment