Nzoni docs
  • Getting Started
  • Angular
    • Project Structure
    • Authentication, Magic Link and Google Auth
    • Landing page
    • Payments and Plans
    • Blog and articles
    • User Dashboard
    • Admin Dashboard
    • SEO & SSR
    • Deploy Angular Project
  • Nest.js
    • Project Structure
    • Authentication, Google auth and Magic link
    • Blogposts
    • Plans
    • Stripe Payment
    • Email and Templates
    • Database and Migration
    • Image File upload
    • Users
    • Deploy Nest.js project
  • Node.js/MongoDB
    • Project structure
    • API endpoints
  • Angular / Firebase / Node.js
  • Create first and default plan
  • Create an Admin User
  • Support
  • Licenses
Powered by GitBook
On this page
  • All migrations path
  • Set environnements variables in .env
  • Run the migration
  • Create a migration
  1. Nest.js

Database and Migration

All migrations path

├── node_modules
├── mail-templates
├── migrations
│   ├── 1661868238821-usersTable.ts              # Users table
│   ├── 1661868315626-subscriptionsTable.ts      # Subscriptions table
│   ├── 1708974949319-BlogpostTable.ts           # Blogposts table
│   ├── 1709027986137-FileUploadTable.ts         # File upload table

Set environnements variables in .env

TYPEORM_HOST=
TYPEORM_PORT=
TYPEORM_USERNAME=
TYPEORM_PASSWORD=
TYPEORM_DATABASE=

Run the migration

npx ts-node ./node_modules/.bin/typeorm  migration:run -d ./datasource.ts

Create a migration

npx typeorm migration:create migrations/nameOfTable
PreviousEmail and TemplatesNextImage File upload

Last updated 1 year ago