... | @@ -50,7 +50,7 @@ A partir dos resultados obtidos, fizemos a seguinte escolha: |
... | @@ -50,7 +50,7 @@ A partir dos resultados obtidos, fizemos a seguinte escolha: |
|
<h2>Script SQL gerado a partir do modelo lógico (astah): </h2>
|
|
<h2>Script SQL gerado a partir do modelo lógico (astah): </h2>
|
|
|
|
|
|
~~~sql
|
|
~~~sql
|
|
CREATE TABLE achivievement (
|
|
CREATE TABLE achievement (
|
|
idAchievement INT NOT NULL,
|
|
idAchievement INT NOT NULL,
|
|
title VARCHAR(100) NOT NULL,
|
|
title VARCHAR(100) NOT NULL,
|
|
description VARCHAR(200) NOT NULL,
|
|
description VARCHAR(200) NOT NULL,
|
... | @@ -58,7 +58,7 @@ CREATE TABLE achivievement ( |
... | @@ -58,7 +58,7 @@ CREATE TABLE achivievement ( |
|
targetScore INT NOT NULL
|
|
targetScore INT NOT NULL
|
|
);
|
|
);
|
|
|
|
|
|
ALTER TABLE achivievement ADD CONSTRAINT PK_achivievement PRIMARY KEY (idAchievement);
|
|
ALTER TABLE achievement ADD CONSTRAINT PK_achievement PRIMARY KEY (idAchievement);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE actor (
|
|
CREATE TABLE actor (
|
... | @@ -189,10 +189,10 @@ ALTER TABLE cast ADD CONSTRAINT PK_cast PRIMARY KEY (idMovie,idActor); |
... | @@ -189,10 +189,10 @@ ALTER TABLE cast ADD CONSTRAINT PK_cast PRIMARY KEY (idMovie,idActor); |
|
|
|
|
|
|
|
|
|
ALTER TABLE user_achievement ADD CONSTRAINT FK_user_achievement_0 FOREIGN KEY (idUser) REFERENCES user (idUser);
|
|
ALTER TABLE user_achievement ADD CONSTRAINT FK_user_achievement_0 FOREIGN KEY (idUser) REFERENCES user (idUser);
|
|
ALTER TABLE user_achievement ADD CONSTRAINT FK_user_achievement_1 FOREIGN KEY (idAchievement) REFERENCES achivievement (idAchievement);
|
|
ALTER TABLE user_achievement ADD CONSTRAINT FK_user_achievement_1 FOREIGN KEY (idAchievement) REFERENCES achievement (idAchievement);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE achievement_tag ADD CONSTRAINT FK_achievement_tag_0 FOREIGN KEY (idAchievement) REFERENCES achivievement (idAchievement);
|
|
ALTER TABLE achievement_tag ADD CONSTRAINT FK_achievement_tag_0 FOREIGN KEY (idAchievement) REFERENCES achievement (idAchievement);
|
|
ALTER TABLE achievement_tag ADD CONSTRAINT FK_achievement_tag_1 FOREIGN KEY (idTag) REFERENCES tag (idTag);
|
|
ALTER TABLE achievement_tag ADD CONSTRAINT FK_achievement_tag_1 FOREIGN KEY (idTag) REFERENCES tag (idTag);
|
|
|
|
|
|
|
|
|
... | @@ -217,7 +217,7 @@ ALTER TABLE user_movie ADD CONSTRAINT FK_user_movie_1 FOREIGN KEY (idMovie) REFE |
... | @@ -217,7 +217,7 @@ ALTER TABLE user_movie ADD CONSTRAINT FK_user_movie_1 FOREIGN KEY (idMovie) REFE |
|
|
|
|
|
|
|
|
|
ALTER TABLE achievement_movie ADD CONSTRAINT FK_achievement_movie_0 FOREIGN KEY (idMovie) REFERENCES movie (idMovie);
|
|
ALTER TABLE achievement_movie ADD CONSTRAINT FK_achievement_movie_0 FOREIGN KEY (idMovie) REFERENCES movie (idMovie);
|
|
ALTER TABLE achievement_movie ADD CONSTRAINT FK_achievement_movie_1 FOREIGN KEY (idAchievement) REFERENCES achivievement (idAchievement);
|
|
ALTER TABLE achievement_movie ADD CONSTRAINT FK_achievement_movie_1 FOREIGN KEY (idAchievement) REFERENCES achievement (idAchievement);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE cast ADD CONSTRAINT FK_cast_0 FOREIGN KEY (idMovie) REFERENCES movie (idMovie);
|
|
ALTER TABLE cast ADD CONSTRAINT FK_cast_0 FOREIGN KEY (idMovie) REFERENCES movie (idMovie);
|
... | | ... | |