Many foreign keys

heres the table

CREATE TABLE network_modules (
   network_module_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
   network_module_type_id INT UNSIGNED, 
   asset_type TINYINT DEFAULT 7,
   chassis_id SMALLINT UNSIGNED,
   chassis_row TINYINT UNSIGNED,
   chassis_col TINYINT UNSIGNED,
   chassis_mounting_direction  ENUM('Front','Back'),
   name VARCHAR(100) DEFAULT 'Unknown',
   notes TEXT,
   created_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
   created_by VARCHAR(50) DEFAULT 'test@industechnology.com',
   updated_date TIMESTAMP NULL,
   updated_by VARCHAR(50),
   operational_status BOOLEAN DEFAULT 1,
   FOREIGN KEY ( network_module_type_id ) REFERENCES network_module_types ( network_module_type_id ),
   FOREIGN KEY ( chassis_id ) REFERENCES chassises ( chassis_id ),
   PRIMARY KEY ( network_module_id )
);

That doesn’t answer Dave’s question at all.
The question is not what the table looks like, but whether there is a row in there where the primary key has value 1.
In other words, is there a row where
network_module_id=1?

The error should have been a hint, the error came up when i tried to INSERT a port on a network_module but the network_module table is empty (xso in order to refer to it, it needs to be populated)


thanks…

Amazing how that works sometimes :winky:

3 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.