Skip to content

postgrelize / PrimaryKey

Variable: PrimaryKey ​

const PrimaryKey: ModelPropertyDecorator

Defined in: src/decorators/column-decorators.ts:46

Makes the attribute part of the primary key (primaryKey: true).

Example ​

ts
class User extends Model {
  @PrimaryKey
  @Column(DataTypes.INTEGER)
  id!: number;
}

Released under the MIT License.