Commit 822a50a5 authored by nanahira's avatar nanahira

updates

parent 9c18d2d9
import { DeletionBase } from './DeletionBase.entity';
import {
Column,
Generated,
PrimaryGeneratedColumn,
SelectQueryBuilder,
} from 'typeorm';
import { Column, Generated, SelectQueryBuilder } from 'typeorm';
import { IdWise } from '../interfaces/wises';
import { ApiProperty } from '@nestjs/swagger';
import { applyQueryProperty } from '../utility/query';
import { NotChangeable, NotWritable } from '../decorators/transform';
import { IsInt, IsOptional, IsPositive } from 'class-validator';
import { NotWritable } from '../decorators/transform';
import { IsInt, IsPositive } from 'class-validator';
import { BigintTransformer } from '../utility/bigint-transform';
export class IdBase extends DeletionBase implements IdWise {
@Generated('increment')
@Column('int8', { primary: true, transformer: new BigintTransformer() })
@Column('bigint', {
primary: true,
unsigned: true,
transformer: new BigintTransformer(),
})
@ApiProperty({ description: '编号', required: false })
@NotWritable()
@IsInt()
......
......@@ -6,8 +6,9 @@ import { BigintTransformer } from '../utility/bigint-transform';
export const RelationColumn = (description = '对应编号', notNull = false) =>
MergePropertyDecorators([
Column('int8', {
Column('bigint', {
nullable: !notNull,
unsigned: true,
transformer: new BigintTransformer(),
}),
ApiProperty({ type: Number, description }),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment