-
Notifications
You must be signed in to change notification settings - Fork 286
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
Add a how-to deal-with-db-migrations to the docs #328
Comments
After reading the related issues, I am not sure to understand if it is possible (and how) to use sequelize-cli to migrate sequelize-typescript models, or if we need to use a pure SQL script. |
As per the linked issue's discussion I can write a blog post that details how to use one of two tools, or both if I feel super gouda. I'll comment updates here as I go, and I can PR a link to the blog in the readme, or we can adapt it as a Wiki post in this github repo (idk how wikis work or if they're any good >.> - do they markdown? Are the SEO friendly?) |
Hey @sanewell92, sounds great. I prefer the readme or another versioned *.md file over github wiki :) Regarding SEO: I think github will do the job for us. |
@sanewell92 Sounds good :) Did you start something? :) |
I'm officially moving my GitHub presence to the @snewell92 account. This won't confusing at all 😆 I have some time to continue the work I started; if you want to follow my progress this is the branch on a fork on the aforementioned account. Feel free to check out commit ab0b572 for the deets. |
@snewell92 did you ever make any progress on this? That branch is dead. |
We are looking to have this feature as well. |
So - I have managed to make the seeders and migrations work with "sequelize": "^6.6.2", import { SequelizeOptions } from 'sequelize-typescript/dist/sequelize/sequelize/sequelize-options'; |
@redevill can you elaborate more in detail how you approached and managed this? An example would be nice. |
I will try: Environment: Sequelize-cli - Setup. `const path = require('path'); module.exports = { Note the javascript file referenced in this file, is found in the Typescript OUTPUT. The code in this file, needs to produce a set of "SequelizeOptions", mostly... because as mentioned above, the migration options are not included in this Type.
So the return JSON object which is the "Mostly" SequelizeOptions would look something like... get_dbOptions returns (JSON Object below not marked as code, because it messes up the formatting) { To use it, you compile your project, then use the instructions in the docs similarly - npx sequelize-cli db:seed:all will run all the seed scripts (location specified above for both the source, and the table name for the registration of the successfully run scripts (sqlzSeed table) @pj035 - Hope this is enlightening. |
As mentioned here #274 and due to sequelize/cli#441 (comment) we should inform users of sequelize-typescript how to deal with db migrations.
The text was updated successfully, but these errors were encountered: