1

So I am using phpmyadmin to create mysql db. I have made SQL scripts, run it and it is successful but when I go to db > designer in phpmyadmin, it doesnt have relationship (line) between the tables.

enter image description here

However, indexes on the table shows it looks like it is connected: enter image description here

Sample scripts I have done:

  CREATE TABLE IF NOT EXISTS location(
        id INT NOT NULL AUTO_INCREMENT,
        tiploc_code VARCHAR(20),
        stanox INT(10),
        crs_code CHAR(3),
        description VARCHAR(30),
        tps_description VARCHAR(30),
        PRIMARY KEY (id)
        );

and I use that location ID to be a foreign key in the calling_points table

     CREATE TABLE IF NOT EXISTS calling_points(
    id INT NOT NULL AUTO_INCREMENT,
    schedule INT,
    calling_type INT,
    location INT,
    arrival TIME,
    departure TIME,
    passing TIME,
    platform CHAR(4),
    departure_line CHAR(3),
    arrival_line CHAR(3),
    engineering_alwc TIME,
    pathing_alwc TIME,
    performance_alwc TIME,
    PRIMARY KEY (id),
    FOREIGN KEY (schedule) REFERENCES schedule(id)
      ON DELETE CASCADE
      ON UPDATE CASCADE,
    FOREIGN KEY (calling_type) REFERENCES calling_type(id)
      ON DELETE CASCADE
      ON UPDATE CASCADE,
    FOREIGN KEY (location) REFERENCES location(id)
      ON DELETE CASCADE
      ON UPDATE CASCADE
 );

Is this normal?

obsessiveCookie
  • 1,130
  • 2
  • 18
  • 33

0 Answers0