PARENT TABLE : app
- Parent table app having two columns ID,APP-ID.
id
int(11) not null auto_increment,
`App-id varchar(20) NOT NULL latin1_bin,
Table column description: - ID = auto increment - APP-ID = varchar with collation type latin1_bin
CHILD TBALE : app_ser
- Child table app_ser having two columns ID,APP-NAME
id
int(11) not null auto_increment,
*`App-name varchar(20) NOT NULL latin1_swedish_ci,**
Table column description: - ID = auto increment - App_Name = varchar with collation type latin1_swedish_ci
My_goal_is:
1) Now i want add a "primary key" on parent table column App-id.
query cmd is : alter table app ADD PRIMARY KEY (App-id)
2) Next i am going to add "foreign key" on child table column App-name.
query cmd is : alter table app_ser ADD CONSTRAINT `fk_app_ser` FOREIGN KEY (`APP_NAME`) REFERENCES `app` (`APP_ID`)
Now I have issue on while run the foreign key query with error code 1215. could you please help me on this ?
Thanks, viswa