question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrations are not detected after schema drop

See original GitHub issue

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:

[ ] latest [ ] @next [X] 0.3.0-alpha.22 (or put your version here)

Steps to reproduce or a small repository showing the problem: I have wanted to clean my database, so I have run : typeorm schema:drop then generate new migrations, but the cli has writen : No changes in database schema were found - cannot generate a migration. To create a new empty migration use "typeorm migration:create" command So I’ve tried to recreate my database, but the problem is still here module.exports = { "type": "postgres", "host": process.env.DATABASE_HOST || "localhost", "port": process.env.DATABASE_PORT || 5432, "username": process.env.DATABASE_USERNAME || "test", "password": process.env.DATABASE_PASSWORD || "test", "database": process.env.DATABASE_DATABASE || "syntrophi-test", "schema": process.env.DATABASE_SCHEMA || "public", "synchronize": false, "logging": true, "entities": [ "build/src/server/model/entities/**/*.js" ], "migrations": [ "build/src/server/model/migrations/**/*.js" ], "cli": { "entitiesDir": "src/server/model/entities", "migrationsDir": "src/server/model/migrations" } };

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

13reactions
akosasantecommented, Feb 9, 2019

+1 I also just now ran into this after cloning my repo to the production server. Would be nice if the error message more clearly indicated that it simply couldn’t find any files at that path. Otherwise, it currently was a bit misleading as it seemed like it found files, but that the migration wasn’t needed. I can take a look at creating a PR to raise an exception/improve the message output if you don’t mind pointing me to the right place?

8reactions
dewevecommented, Feb 9, 2019

It would be clearer if the message said: ‘the migrations files are missing’ or ‘No migration files’. I remember when I’ve init a typeorm project, I’ve spent times figuring it out, I needed to first compile the migrations to run them

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django - makemigrations - No changes detected
There are multiple possible reasons for django not detecting what to migrate during the makemigrations command. migration folder You need a migrations ...
Read more >
Migration troubleshooting in development - Prisma
This guide describes how to resolve issues with Prisma Migrate in a development environment, which often involves resetting your database.
Read more >
Database: Migrations - The PHP Framework For Web Artisans
Schema dumps may not be restored to in-memory SQLite databases. Migration Structure. A migration class contains two methods: up and down . The...
Read more >
Migrations - Django documentation
Migrations ¶. Migrations are Django's way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your...
Read more >
Migrations - Drift - Simon Binder
During development, you might be changing your schema very often and don't want to write migrations for that yet. You can just delete...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found