Skip to content

Commit

Permalink
Merge pull request #26 from SBD1/feat/add-inserts
Browse files Browse the repository at this point in the history
adicionando inserts e create table
  • Loading branch information
gatotabaco authored Dec 12, 2023
2 parents 8644eb6 + 1edbc1e commit cb0330d
Show file tree
Hide file tree
Showing 2 changed files with 274 additions and 169 deletions.
24 changes: 11 additions & 13 deletions sql/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ CREATE TABLE legivel(
conteudo TEXT NOT NULL,
valor int default 0,
peso int NOT NULL,
nome VARCHAR(25) NOT NULL,
nome VARCHAR(50) NOT NULL,
descricao text DEFAULT ''
);

Expand Down Expand Up @@ -85,17 +85,23 @@ CREATE TABLE chave(
descricao text DEFAULT ''
);

CREATE TABLE alma(
nome VARCHAR(30) PRIMARY KEY,
descricao TEXT DEFAULT ''
);

CREATE TABLE personagem(
idPersonagem SERIAL PRIMARY KEY,
alma VARCHAR(30) REFERENCES Alma (nome),
tipoP VARCHAR(3) NOT NULL
);

CREATE TABLE personagem_jogavel(
idPersonagem SERIAL PRIMARY KEY REFERENCES personagem (idPersonagem),
acessorio1 SERIAL REFERENCES acessorio (idItem),
acessorio2 SERIAL REFERENCES acessorio (idItem),
armadura SERIAL REFERENCES armadura (idItem),
arma SERIAL REFERENCES arma (idItem),
acessorio1 INTEGER NULL REFERENCES acessorio (idItem),
acessorio2 INTEGER NULL REFERENCES acessorio (idItem),
armadura INTEGER NULL REFERENCES armadura (idItem),
arma INTEGER NULL REFERENCES arma (idItem),
menteAtual INT NOT NULL,
menteMax INT NOT NULL,
hpAtual INT NOT NULL,
Expand Down Expand Up @@ -145,14 +151,6 @@ CREATE TABLE inimigo(
nome TEXT NOT NULL
);

CREATE TABLE alma(
nome VARCHAR(25) PRIMARY KEY,
idPersonagem SERIAL REFERENCES personagem_jogavel(idPersonagem),
descricao TEXT DEFAULT ''
);

ALTER TABLE personagem ADD COLUMN alma TEXT REFERENCES alma (nome);

CREATE TABLE parte(
idParte SERIAL,
idPersonagem INT,
Expand Down
Loading

0 comments on commit cb0330d

Please sign in to comment.