Added version column test
This commit is contained in:
parent
1d550f8589
commit
d5be96adf4
18
test/integration/examples/sample17-versioning/entity/Post.ts
Normal file
18
test/integration/examples/sample17-versioning/entity/Post.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { Column, Entity, Index, PrimaryGeneratedColumn, VersionColumn } from "typeorm"
|
||||
|
||||
@Entity("Post")
|
||||
export class Post {
|
||||
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
title: string;
|
||||
|
||||
@Column()
|
||||
text: string;
|
||||
|
||||
@VersionColumn()
|
||||
version: number;
|
||||
|
||||
}
|
@ -148,6 +148,18 @@ export class EntityFileToJson {
|
||||
retVal.columns.push(col);
|
||||
continue;
|
||||
}
|
||||
} else if (trimmedLine.startsWith('@VersionColumn')) {
|
||||
if (this.isPartOfMultilineStatement(trimmedLine)) {
|
||||
isMultilineStatement = true;
|
||||
priorPartOfMultilineStatement = trimmedLine;
|
||||
continue;
|
||||
} else {
|
||||
isMultilineStatement = false;
|
||||
let col = new EntityColumn()
|
||||
this.getColumnOptionsAndType(trimmedLine, col)
|
||||
retVal.columns.push(col);
|
||||
continue;
|
||||
}
|
||||
} else if (trimmedLine.startsWith('@PrimaryGeneratedColumn')) {
|
||||
if (this.isPartOfMultilineStatement(trimmedLine)) {
|
||||
isMultilineStatement = true;
|
||||
@ -246,10 +258,14 @@ export class EntityFileToJson {
|
||||
}
|
||||
})
|
||||
continue
|
||||
} else if (trimmedLine = '}') {
|
||||
} else if (trimmedLine == '}') {
|
||||
isInClassBody = false;
|
||||
continue; //class declaration end
|
||||
}
|
||||
else {
|
||||
console.log(`[EntityFileToJson:convert] Line not recognized in entity ${retVal.entityName}:`)
|
||||
console.log(`${trimmedLine}`)
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`[EntityFileToJson:convert] Line not recognized in entity ${retVal.entityName}:`)
|
||||
|
Loading…
Reference in New Issue
Block a user