Mysql Bigint plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install http://svn.northpub.com/plugins/mysql_bigint
Integer Columns
===============
There isn't any additional syntax needed to use this plugin on integer columns, in MySQL. Instead the :limit parameter now specifics the number of bytes expected and smallest MySQL type capable of suppporting that many bytes will be used, up to a maximum of 8 bytes. For example...
t.column "col1", :integer, :limit => 1, :null=> false # uses MySQL tinyint
t.column "col2", :integer, :limit => 3, :null=> false # uses MySQL mediumint
t.column "col3", :integer, :limit => 4, :null=> false # uses MySQL int
t.column "col4", :integer, :limit => 5, :null=> false # uses MySQL bigint
t.column "col5", :integer, :limit => 8, :null=> false # uses MySQL bigint
t.column "col6", :integer, :limit => 12, :null=> false # uses MySQL bigint which still holds 8-bytes
Primary Keys
=============
You can also use bigint's as primary keys with this plugin. This does require a bit of syntax. Add the :use_big_id option to the create_table statement as shown below.
create_table :random_numbers, :use_big_id => true, :force => true do |t|
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, 7 months ago

