Scaffolding reference

I kept looking up the following in various places so here it is in one!
Scaffolding datatypes, fields, etc.
Scaffolding example:
script/generate scaffold patient_info

	
pt_code:string pt_external_id:integer 
image_2010:blob, :limit => 2.megabytes
account_active:boolean, :default => true dob:date, :null => true 
first_visit:datetime
average_2010_score:float not_rails_format_id:primary_key
average_payment:decimal, :precision => 6, :scale => 2
long_description:text, :limit => 10000, last_payment_date:timestamp 
am_alarm_time:time

migration to MYsql mappings:

:binary	     
TINYBLOB, BLOB, MEDIUMBLOB, or LONGBLOB2 
                     :limit => 1 to 4294967296 (default = 65536)
:boolean     TINYINT(1)	
:date        DATE	
:datetime    DATETIME	
:decimal     DECIMAL 
                     :precision => 1 to 63 (default = 10) 
                     :scale => 0 to 30 (default = 0)
:float       FLOAT
:integer     INT :limit => 1 to 11 (default = 11)
:primary_key INT(11) AUTO_INCREMENT PRIMARY KEY	
:string      VARCHAR :limit => 1 to 255 (default = 255)
:text        TINYTEXT, TEXT, MEDIUMTEXT, or LONGTEXT2 
                     :limit => 1 to 4294967296 (default = 65536)
:time        TIME	
:timestamp   DATETIME
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s