Bom dia pessoal!
Estou desenvolvendo um banco de dados com mySql, quando tento atribuir uma pk a algum campo da tabela ele simplesmente desmarca a pk.
Sou novato em Banco de dados, não sei se isto tem algo relacionado com o Index Type, estou um pouco perdido.
Será que vocês poderiam me dar uma ajuda, por favor?
segue código de uma das tabelas abaixo
--
-- Definition of table `aluno`
--
DROP TABLE IF EXISTS `aluno`;
CREATE TABLE `aluno` (
`idAluno` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT,
`sala` int(10) unsigned NOT NULL,
`periodo` varchar(45) NOT NULL,
`presenca` int(10) unsigned NOT NULL,
`situacao` tinyint(1) NOT NULL,
`idInstituicaoEnsino` int(10) unsigned NOT NULL,
`idPessoa` int(10) unsigned NOT NULL,
PRIMARY KEY (`idAluno`) USING BTREE,
KEY `FK_aluno_instituicao_ensino` (`idInstituicaoEnsino`),
KEY `FK_aluno_pessoa` (`idPessoa`),
CONSTRAINT `FK_aluno_instituicao_ensino` FOREIGN KEY (`idInstituicaoEnsino`) REFERENCES `instituicaoensino` (`idInstituicao`),
CONSTRAINT `FK_aluno_pessoa` FOREIGN KEY (`idPessoa`) REFERENCES `pessoa` (`idPessoa`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
--
-- Dumping data for table `aluno`
--
/*!40000 ALTER TABLE `aluno` DISABLE KEYS */;
/*!40000 ALTER TABLE `aluno` ENABLE KEYS */;
att,
Fernando Stadler