Hallo zusammen
Ich bekomme diese Fehlermeldung, wenn ich die Tabelle "virtual_swich" 1:1 erweitern will:
SHOW WARNINGS;
USE relay;
set @var=if((SELECT true FROM information_schema.TABLE_CONSTRAINTS WHERE
CONSTRAINT_SCHEMA = DATABASE() AND
TABLE_NAME = 'virtual_switch_hierarchy' AND
CONSTRAINT_NAME = 'fk_virtual_switch_hierarchy' AND
CONSTRAINT_TYPE = 'FOREIGN KEY') = true,'ALTER TABLE virtual_switch_hierarchy
drop foreign key fk_virtual_switch_hierarchy','select 1');
prepare stmt from @var;
execute stmt;
deallocate prepare stmt;
DROP TABLE IF EXISTS virtual_switch_hierarchy;
CREATE TABLE IF NOT EXISTS virtual_switch_hierarchy (
taster_id INT NOT NULL AUTO_INCREMENT,
created_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (taster_id),
UNIQUE INDEX id_UNIQUE (taster_id ASC),
CONSTRAINT fk_virtual_switch_hierarchy
FOREIGN KEY (taster_id)
REFERENCES virtual_switch (taster_id)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARACTER SET = utf8;
...aber warum geht denn das hier, das entbehrt sich ja jeglicher Logik:
Define one-to-one relationship in MySQL | ADMFactory.com
???
Danke für die Feedbacks!
Ich bekomme diese Fehlermeldung, wenn ich die Tabelle "virtual_swich" 1:1 erweitern will:
SHOW WARNINGS;
USE relay;
set @var=if((SELECT true FROM information_schema.TABLE_CONSTRAINTS WHERE
CONSTRAINT_SCHEMA = DATABASE() AND
TABLE_NAME = 'virtual_switch_hierarchy' AND
CONSTRAINT_NAME = 'fk_virtual_switch_hierarchy' AND
CONSTRAINT_TYPE = 'FOREIGN KEY') = true,'ALTER TABLE virtual_switch_hierarchy
drop foreign key fk_virtual_switch_hierarchy','select 1');
prepare stmt from @var;
execute stmt;
deallocate prepare stmt;
DROP TABLE IF EXISTS virtual_switch_hierarchy;
CREATE TABLE IF NOT EXISTS virtual_switch_hierarchy (
taster_id INT NOT NULL AUTO_INCREMENT,
created_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (taster_id),
UNIQUE INDEX id_UNIQUE (taster_id ASC),
CONSTRAINT fk_virtual_switch_hierarchy
FOREIGN KEY (taster_id)
REFERENCES virtual_switch (taster_id)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARACTER SET = utf8;
...aber warum geht denn das hier, das entbehrt sich ja jeglicher Logik:
Define one-to-one relationship in MySQL | ADMFactory.com
???
Danke für die Feedbacks!