Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CREATE TABLE UserTabs (
  UserID INT NOT NULL,
  TabID INT NOT NULL,
  PRIMARY KEY (UserID, TabID));

DriverRaces table

CREATE TABLE DriverRaces (
  RaceID INT NOT NULL,
  DriverID INT NOT NULL,
  RoundID INT NOT NULL,
  PRIMARY KEY (RaceID, DriverID, RoundID)
);

...

CREATE TABLE TabGraphs (
  TabID INT NOT NULL,
  GraphID INT NOT NULL,
  PRIMARY KEY (TabID, GraphID)
  );

Tabs table

  CREATE TABLE Tabs (
  TabID INT NOT NULL,
  TabName varchar(255) NOT NULL,
  RaceID INT NOT NULL,
  PRIMARY KEY (TabID)
  );

...

ALTER TABLE UserTabs
ADD CONSTRAINT fk_UserTabsID FOREIGN KEY (UserID) REFERENCES User(UserID);

...

TabGraphs TabID to

...

Tab TabID

ALTER TABLE Tabs
ADD CONSTRAINT fk_GraphsTabID FOREIGN KEY (TabID) REFERENCES TabGraphsTab(TabID);

TabGraphs GraphID to Graphs GraphID

...