Skip to main content

TypeORM

  1. Selecting Database when installing create-frourio-app

  2. Start the Database

  3. Create an entity file

    server/entity/Task.ts
    import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'
    @Entity()
    export class Task {
    @PrimaryGeneratedColumn()
    id: number
    @Column({ length: 100 })
    label: string
    @Column({ default: false })
    done: boolean
    }

    TypeORM entities


  1. Call the migration command
npm run migration:generate

  1. Migration is done to the DB