Skip to content

Migration should either read .ts or deliver a .js #1675

@gabrielDevlog

Description

@gabrielDevlog

This is either a bug or a new feature

[ ] question
[ x] bug report
[x ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[ x] postgres
[ ] sqlite
[ ] sqljs
[ ] websql

TypeORM version:

[x ] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:
typeorm migrations:generate -n test this create typecript file test.ts
typeorm migrations:run this fails with Unexpected token import

What solves the issue
Either call typeorm using ts-node, as explained here : #1561
Either transpile .ts file .js using typescript

Expected behaviour
Typeorm should be able to read the file it generated, which means : reading ts file or providing .js file

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions