title: TypeORM PrimaryGeneratedColumn UUID : Null value in column id on save
body: <p>I got a NestJs project with typeORM and a postgresl database. I want to have entity with id as generated uuid. When I save it seems like the uuid is not generated and the entity is saved with a null id.</p>
  <p>My entity file :</p>
  <pre><code>import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
  import { JobStatusEnum } from './jobStatus.enum';
  
  @Entity()
  export class Job {
    @PrimaryGeneratedColumn('uuid')
    id: string;
  
    @Column()
    name: string;
  
    ...
  }
  </code></pre>
  <p>My service :</p>
  <pre><code>import { Injectable } from '@nestjs/common';
  import { Job } from '../model/job.entity';
  import { InjectRepository } from '@nestjs/typeorm';
  import { Repository } from 'typeorm';
  
  @Injectable()
  export class JobService {
    constructor(@InjectRepository(Job) private jobRepository: Repository&lt;Job&gt;) {}
  
    create(): Promise&lt;Job&gt; {
  
      const job: Job = {
        id: null,
        name: 'Job Name',
        ...
      };
  
      return this.jobRepository.save(job);
    }
    ...
  }
  </code></pre>
  <p>The error message I get :</p>
  <pre><code>UnhandledPromiseRejectionWarning: QueryFailedError: null value in column &quot;id&quot; of relation &quot;job&quot; violates not-null constraint
  </code></pre>