@alexanderwsp/db.sheep.entities

1.0.9 • Public • Published

Levantar el proyecto

CREATE ROLE sheep_bah LOGIN SUPERUSER PASSWORD 'ship01234';

create database db_sheep
with
owner = sheep_bah
encoding = 'UTF8'
connection
limit = -1;
DATABASE_URL=postgres://sheep_bah:ship01234@127.0.0.1:5432/db_sheep
npm i
npm run migration:run

Listo! este proyecto sirve para ejecutar las migraciones, no debe estar corriendo.

Generar nueva migración

Luego de haber creado la entidad como un archivo .ts, ejecute lo suguiente.

npm run migration:generate --name=init
# Luego
npm run migration:run

Crear proyecto ts typeOrm dede 0

npx typeorm init --name db.sheep.entities --database postgres

Eliminar base de datos en caso de limpiar la DB

drop database db_sheep
-- Luego cree nuevamente la base
create database db_sheep
with
owner = sheep_bah
encoding = 'UTF8'
connection
limit = -1;

Crear proyecto NestJs desde 0

nest new <proyecto>

Crear crud

nest g resource <module>

Eliminar archivos innecesarios

  • Eliminar los archivos Controller y Service
  • Modificar el app.module.ts y eliminar las referencias de los archivos antes mencionados

Instalar el validador DTO

npm i --save class-validator class-transformer
  • Agregar app.useGlobalPipes(new ValidationPipe()); en el main.ts

Readme

Keywords

none

Package Sidebar

Install

npm i @alexanderwsp/db.sheep.entities

Weekly Downloads

0

Version

1.0.9

License

none

Unpacked Size

225 kB

Total Files

102

Last publish

Collaborators

  • awsp_