sergio.souza
(usa Suse)
Enviado em 28/11/2007 - 14:43h
Olá,
não consigo criar uma tabela do tipo innoDB utilizando particionamento, quando existe uma foreign key na tabela. Estou fazendo algo errado? Ou existe outra forma de fazer isto? Vejam o comando que estou usando:
CREATE TABLE `enterprise`.`logradouro` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT 'Codigo do Logradouro',
`bai_id` INT NOT NULL COMMENT 'Codigo do Bairro',
`nome` VARCHAR(255) NOT NULL COMMENT 'Nome do Logradouro',
`complemento` VARCHAR(255) DEFAULT NULL COMMENT 'Complemento do Logradouro',
`cep` CHAR(8) NOT NULL COMMENT 'CEP do Logradouro',
PRIMARY KEY (`id`),
CONSTRAINT `fk_bairro_log` FOREIGN KEY `fk_bairro_log` (`bai_id`)
REFERENCES `bairro` (`id`)
ON DELETE RESTRICT
ON UPDATE RESTRICT
)
ENGINE = InnoDB
COMMENT = 'Tabela de Logradouros'
PARTITION BY RANGE (id) (
PARTITION p0 VALUES LESS THAN (100000),
PARTITION p1 VALUES LESS THAN (200000),
PARTITION p2 VALUES LESS THAN (300000),
PARTITION p3 VALUES LESS THAN (400000),
PARTITION p4 VALUES LESS THAN (500000),
PARTITION p5 VALUES LESS THAN (600000),
PARTITION p6 VALUES LESS THAN (700000),
PARTITION p7 VALUES LESS THAN (800000),
PARTITION p8 VALUES LESS THAN (900000),
PARTITION p9 VALUES LESS THAN (1000000),
PARTITION p10 VALUES LESS THAN (1100000),
PARTITION p11 VALUES LESS THAN (1200000),
PARTITION p12 VALUES LESS THAN (1300000),
PARTITION p13 VALUES LESS THAN (1400000),
PARTITION p14 VALUES LESS THAN (1500000),
PARTITION p15 VALUES LESS THAN (1600000),
PARTITION p16 VALUES LESS THAN (1700000),
PARTITION p17 VALUES LESS THAN (1800000),
PARTITION p18 VALUES LESS THAN (1900000),
PARTITION p19 VALUES LESS THAN (2000000),
PARTITION p20 VALUES LESS THAN (2100000),
PARTITION p21 VALUES LESS THAN (2200000),
PARTITION p22 VALUES LESS THAN (2300000),
PARTITION p23 VALUES LESS THAN (2400000),
PARTITION p24 VALUES LESS THAN (2500000),
PARTITION p25 VALUES LESS THAN (2600000),
PARTITION p26 VALUES LESS THAN (2700000),
PARTITION p27 VALUES LESS THAN (2800000),
PARTITION p28 VALUES LESS THAN (2900000),
PARTITION p29 VALUES LESS THAN (3000000),
PARTITION p30 VALUES LESS THAN MAXVALUE
);