Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations fail after upgrading from 0.1.16 to 0.2.8 #2964

Closed
danielmhanover opened this issue Oct 22, 2018 · 2 comments
Closed

Migrations fail after upgrading from 0.1.16 to 0.2.8 #2964

danielmhanover opened this issue Oct 22, 2018 · 2 comments

Comments

@danielmhanover
Copy link

danielmhanover commented Oct 22, 2018

Issue type:

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

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

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

Steps to reproduce or a small repository showing the problem:

Create a few entities with foreign keys and primary keys in TypeORM 0.1.16 and sync to a Postgres DB. Then update to TypeORM 0.2.8 and then, sync again (using either synchronize: true or migration:generate). The migration file will contain a number of strange (and failing) commands such as queryRunner.query(``ALTER TABLE "Payments" DROP CONSTRAINT "PK_c1ed52d44692c02be2669cb3e30"``); even though no constraint with that ID exists.

It will also attempt to drop and re-add every column, regardless of whether its actually changed.

@btxtiger
Copy link

Are you using unsigned columns? Could be related to #2943

@havenchyk
Copy link
Contributor

@danielmhanover yes, 0.2.0 contained breaking changes, constraints were re-created. Try to upgrade first to 0.2.0 and then to the latest version.

In case of further questions just ask here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants