fix: fk type invalid (#1113)

This commit is contained in:
chenos 2022-11-21 14:58:07 +08:00 committed by GitHub
parent 7b016848bd
commit c52f451840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,12 @@ export function afterCreateForForeignKeyField(db: Database) {
// Foreign key types are only integer and string
function attribute2field(attribute: any) {
const type = attribute.type.constructor.name === 'INTEGER' ? 'integer' : 'string';
let type = 'bigInt';
if (attribute.type.constructor.name === 'INTEGER') {
type = 'integer';
} else if (attribute.type.constructor.name === 'STRING') {
type = 'string';
}
const name = attribute.fieldName;
const data = {
interface: 'integer',