Skip to content
Open

Test #14

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added revistaCientifica/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions revistaCientifica/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Backend\src\bd.js
Backend\src\config.js
6 changes: 6 additions & 0 deletions revistaCientifica/Backend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PORT=3000
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=
DB_NAME=revistaUAM
2 changes: 2 additions & 0 deletions revistaCientifica/Backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Backend/src/config.js
Backend/src/bd.js
60 changes: 0 additions & 60 deletions revistaCientifica/Backend/controllers/articles.controller.js

This file was deleted.

11 changes: 0 additions & 11 deletions revistaCientifica/Backend/db.js

This file was deleted.

50 changes: 50 additions & 0 deletions revistaCientifica/Backend/db/main_script.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
create table if not exists usuarios (
id_usuario int primary key not null,
nombre varchar(30),
apellido varchar(30),
correo varchar(40),
contrasena varchar(20)
);

create table if not exists autores(
id_usuario int primary key not null
);

create table tematicas(
id_tematica serial primary key,
nombre varchar(20)
);

create table editores(
id_usuario int primary key not null
);

create table if not exists articulos(
id_articulo serial primary key,
editor_fk int,
autor_fk int,
titulo varchar(40),
resumen varchar(250),
ruta varchar(100),
constraint articulos_editor_fk foreign key(editor_fk)
references editores(id_usuario) match simple
on update no action
on delete no action,
constraint articulos_autor_fk foreign key(autor_fk)
references autores(id_usuario) match simple
on update no action
on delete no action
);

create table articulo_tematica(
articulo_fk int,
tematica_fk int,
constraint articulo_tematica_articulo_fk foreign key(articulo_fk)
references articulos(id_articulo) match simple
on update no action
on delete no action,
constraint articulo_tematica_tematica_fk foreign key(tematica_fk)
references tematicas(id_tematica) match simple
on update restrict
on delete restrict
);
22 changes: 22 additions & 0 deletions revistaCientifica/Backend/db/triggers_script.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Trigger de creación de autores a través del usuarios
LANGUAGE PLPGSQL
AS $$
BEGIN
INSERT INTO autores (id_usuario)
VALUES (NEW.id_usuario);
RETURN NEW;
END;
$$;

drop function crear_autor_trigger_func();

CREATE TRIGGER generar_autor
AFTER INSERT
ON usuarios
FOR EACH ROW
EXECUTE PROCEDURE crear_autor_trigger_func();

drop trigger if exists generar_autor on usuarios;

delete from usuarios;
//-----------------------------------------------
19 changes: 0 additions & 19 deletions revistaCientifica/Backend/index.js

This file was deleted.

1 change: 1 addition & 0 deletions revistaCientifica/Backend/node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions revistaCientifica/Backend/node_modules/.bin/mime.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions revistaCientifica/Backend/node_modules/.bin/mime.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions revistaCientifica/Backend/node_modules/.bin/mkdirp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions revistaCientifica/Backend/node_modules/.bin/nodemon

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions revistaCientifica/Backend/node_modules/.bin/nodemon.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions revistaCientifica/Backend/node_modules/.bin/nodemon.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions revistaCientifica/Backend/node_modules/.bin/nodetouch

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions revistaCientifica/Backend/node_modules/.bin/nodetouch.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions revistaCientifica/Backend/node_modules/.bin/nodetouch.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions revistaCientifica/Backend/node_modules/.bin/nopt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions revistaCientifica/Backend/node_modules/.bin/nopt.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions revistaCientifica/Backend/node_modules/.bin/nopt.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions revistaCientifica/Backend/node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading