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: mysql, syantax, linux, rails, linus vs windows compatibility, syntax error for migrations on linux
3 comments March 18, 2008