Created
February 11, 2013 19:54
-
-
Save kenmazaika/4757077 to your computer and use it in GitHub Desktop.
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
| class CreateYolos < ActiveRecord::Migration | |
| def change | |
| create_table :yolos do |t| | |
| # The correct way to add a `longtext` field to table | |
| t.text :swag, :limit => 0xffffffff | |
| t.timestamps | |
| end | |
| end | |
| end |
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
| mysql> show create table yolos; | |
| +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |
| | Table | Create Table | | |
| +-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |
| | yolos | CREATE TABLE `yolos` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `swag` longtext COLLATE utf8_unicode_ci, | |
| `created_at` datetime NOT NULL, | |
| `updated_at` datetime NOT 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