Comments (7)
That is because of https://github.com/sequelize/umzug/blob/master/lib/storages/sequelize.js#L84 Why would you consider that a bottleneck?
from cli.
I can see that this is far from ideal. But tbh it has for me ultra high priority.
from cli.
Why would you consider that a bottleneck?
Because you don't need to initialize it and check on each migration run, but i think you already know that. :)
By the way, thanks for changing the table schema, it solved some problems we were getting when merging PRs with different timings. 👍
from cli.
That is because of https://github.com/sequelize/umzug/blob/master/lib/storages/sequelize.js#L84
Unfortunately this link is dead :-(
Why would you consider that a bottleneck?
This seems terribly inefficient. For each migration file (which we have over a hundred), the following 5 extra SQL statements are made (that I believe are unnecessary):
- 2x
CREATE TABLE IF NOT EXISTS
- 2x
SHOW INDEX FROM `SequelizeMeta`
- 1x
SELECT `name` FROM `SequelizeMeta`
Surely nobody is running two migrators against the same DB at the same time. And if they are, I don't see how this would help.
from cli.
Updated link:
https://github.com/sequelize/umzug/blob/67f99bcbee71da0f4a99d56edadc8b59e68bc6fe/src/storages/SequelizeStorage.js#L74-L93
Seems that now it is defined and re-used.
@rsshilli does it still happens?
from cli.
I'm on Umzug 1.11.0 (is that the latest?). I still see all of the SQL I mentioned above.
I worked around this mayhem by creating a mysql dump that I use to initialize new user's DBs. When a new user signs up, I'm reading in the MySQL dump and executing the queries one by one rather than executing the umzug migrations.
A few comparisons:
- 156 migration files runs in ~10.7 seconds on an AWS t2.small RDS MySQL DB.
- My mysql dump file runs in ~3.1 seconds (same SQL but without the extra needless create table, etc above)
I should also note that I (have to) turn off foreign key checks in the mysql dump (although there's no data there). But I suspect that makes the table creation a little faster. I'd be surprised if that made it twice as fast though.
from cli.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from cli.
Related Issues (20)
- BulkInsert "relation does not exist" in migration script
- const model = require(path.join(__dirname, file)).default( ^ TypeError: require(...).default is not a function
- const model = require(path.join(__dirname, file)).default( ^ TypeError: require(...).default is not a function HOT 1
- Sequelize CLI Fails to Authenticate with Postgres DB Containing a ':' in Password HOT 4
- CLI is not taking default env like node latest versions have (20.8.0)
- SequelizeMeta structure incompatible with SingleStore/memsql HOT 2
- Problem running migrations with yarn
- When on typescript project, sequelize-cli still generates javascript files. HOT 3
- Running migrations, on Azure database HOT 1
- Seeders state in database with using url option
- Migration undo command didn't work correctly. HOT 1
- where condition in literal HOT 1
- nested dependency es5-ext has a security vulnerability (low) and needs update HOT 1
- Subsequent migrations fail after running db:migrate:schema:timestamps:add command
- Please install sqlite3 package manually
- Incompatibility Error with [email protected] and Node.js 21.7.3 HOT 2
- Error: Dialect needs to be explicitly supplied as of v4.0.0 HOT 2
- npx sequelize-cli db:migrate command don't read the environment variables with PM2 HOT 2
- ERROR: Error reading "config\config.js". Error: undefined. Migracion con sequelize-cli HOT 6
- Dialect options being ignored for mssql named instance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.