Posts Tagged linus vs windows compatibility

“MySQL query compatible with both linux and windows”

I just came across this issue when i made the migrations on a windows and tried running them on linux

I am of the opinion that we should be using the below given syntax so
that the migration works on both windows and linux machines.(DO correct
me if i am wrong)

The below syntax doesn’t work on LINUX:

CREATE TABLE ‘employee_roles’ (

‘id’ INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT,

‘employee_role_type’ VARCHAR(50) NOT NULL,

PRIMARY KEY(‘id’)

)

TYPE = MYISAM;

The below code works on LINUX and windows:

CREATE TABLE employee_roles (

id INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT,

employee_role_type VARCHAR(50) NOT NULL,

PRIMARY KEY(id)

)

ENGINE = MYISAM

The only difference is that we are not using the single inverted quote ,
so just do find and replace all .

Also mention ENGINE=MYISAM not TYPE=MYISAM as type is deprecated.

Technorati Tags: , , , , ,

3 comments March 18, 2008


Recent Posts

Tags

Active Record australian gp calendar date select capistrano capitalize debugging Debugging in rails edge rails formula 1 For those who dont want to update the prototype.js fun Fun baby fun google html in join javascript linus vs windows compatibility linux logging love song malaysian gp 2008 results melbourne migrations music mysql plugin poetry rails regexp regular expression results formula 1 opening race romantic poetry ror Ruby ruby on rails safe html sms song SQL string case handler for strings syantax syntax error for migrations on linux Text Area they can checkout 1.8.3 of the calender date select

Blogroll

Pages