Commit 0e12bf1c authored by nanahira's avatar nanahira

change archive to bigint

parent 343bd0d8
Pipeline #39011 passed with stages
in 3 minutes and 15 seconds
......@@ -2,6 +2,7 @@ import { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn } from 'typeor
import { Build } from './Build.entity';
import { TimeBase } from './TimeBase.entity';
import { ArchiveMirror } from './ArchiveMirror.entity';
import { BigintTransformer } from 'src/utility/bigint';
export enum ArchiveType {
Full = 'full',
......@@ -27,7 +28,7 @@ export class Archive extends TimeBase {
@Column('varchar', { length: 64, nullable: true })
hash: string;
@Column('int', { unsigned: true })
@Column('bigint', { unsigned: true, transformer: new BigintTransformer() })
size: number;
@ManyToOne((type) => Build, (build) => build.archives, { onDelete: 'CASCADE' })
......
import { ValueTransformer } from 'typeorm';
export class BigintTransformer implements ValueTransformer {
from(dbValue) {
if (dbValue == null) {
return dbValue;
}
return parseInt(dbValue);
}
to(entValue): any {
return entValue;
}
}
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