Composite keys
Posted: 2013-10-29 17:08
I have a table that has this layout in MySQL:
'CREATE TABLE `bread` (
`rundate` varchar(20) NOT NULL,
`runtime` varchar(20) NOT NULL,
`bread` int(11) DEFAULT NULL,
`lread` int(11) DEFAULT NULL,
`rcache` int(11) DEFAULT NULL,
`bwrit` int(11) DEFAULT NULL,
`lwrit` int(11) DEFAULT NULL,
`wcache` int(11) DEFAULT NULL,
`pread` int(11) DEFAULT NULL,
`pwrit` int(11) DEFAULT NULL,
PRIMARY KEY (`rundate`,`runtime`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1'
When I try to generate the app, I get this error message: Table 'bread' has too many primary keys. Only one primary key is allowed per table. Is there a way to use composite keys?
How do I work around this?
Thanks,
Tim
'CREATE TABLE `bread` (
`rundate` varchar(20) NOT NULL,
`runtime` varchar(20) NOT NULL,
`bread` int(11) DEFAULT NULL,
`lread` int(11) DEFAULT NULL,
`rcache` int(11) DEFAULT NULL,
`bwrit` int(11) DEFAULT NULL,
`lwrit` int(11) DEFAULT NULL,
`wcache` int(11) DEFAULT NULL,
`pread` int(11) DEFAULT NULL,
`pwrit` int(11) DEFAULT NULL,
PRIMARY KEY (`rundate`,`runtime`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1'
When I try to generate the app, I get this error message: Table 'bread' has too many primary keys. Only one primary key is allowed per table. Is there a way to use composite keys?
How do I work around this?
Thanks,
Tim