Migrations are not detected after schema drop
See original GitHub issueIssue 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:
- Created 5 years ago
- Comments:19 (7 by maintainers)
+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?
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