sqlite: typeorm migration:generate
See original GitHub issueIssue type:
[X] question [ ] bug report [ ] feature request [X] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql
/ mariadb
[ ] oracle
[ ] postgres
[X] sqlite
[ ] sqljs
[ ] react-native
TypeORM version:
[X] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Running typeorm migration:generate -n PostRefactoring
just hangs. Is there specific documentation for using generate in sqlite?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Migrations - typeorm - GitBook
typeorm migration :create and typeorm migration:generate will create .ts files, unless you use the o flag (see more in Generating migrations).
Read more >typeorm migration:generate - Fig.io
Generates a new migration file with sql needs to be executed to update schema.
Read more >TypeORM: Doesn't create database table when running ...
1 migrations are new migrations that needs to be executed. query: BEGIN TRANSACTION query: CREATE TABLE "url" ("id" integer PRIMARY KEY ...
Read more >Using TypeORM migrations for simple database seeding ...
Migrations generated by TypeORM are mostly made of raw SQL queries. TypeORM is creating a class that implements MigrationInterface and ...
Read more >TypeORM - Amazing ORM for TypeScript and JavaScript (ES7 ...
for SQLite. npm install sqlite3 --save. for Microsoft SQL Server ... This command will generate a new project in the MyProject directory with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So I have it working doing the following:
In the ormconfig.json add a local copy of the database. Migrations will now be generated against the local copy of the database.
Install ts-node and typescript
npm install -g ts-node typescript
Added the following to the package.json
And I can not run migrations with this
npm run migrate -- n [name here]
I had the same issue caused by having incorrect path to database
"database": "dist/assets/data/database",
instead of"database": "dist/assets/data/database.db",
inside ormconfig.json