-
-
Notifications
You must be signed in to change notification settings - Fork 529
include non-migration files in the migrations folder #1113
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
Comments
Hi! I tried to reproduce this with a random non-migration file in #1114 but the tests that we use pass on that. Could you elaborate more on the error message or provide us with a failing PR? |
I would expect it to throw, just in case the up and down methods were not exported I think we should look into adding an (it would also solve the issue we have with |
Try to export that sum function. Migrator uses exported functions. My file that failed migrations was exported like other migrations. I used it to provided names for the tables. I couldn't generate my migraiton because I use nestjs and typescript. const TableNames = {
Users: 'Users',
PublicFiles: 'PublicFiles',
};
module.exports = {
TableNames,
}; |
Closing this in favour of #756 |
Issue Creation Checklist
Feature Description
I get such error: ERROR: Could not find migration method: up. I have three migration files all with up and down methods. I have .sequelizerc and config.js files. I am running my migration with this command
The migrations are displayed in postgres and tables are created, but error is thrown at the end.
I've debugged migration script and found out that every file in migration folder must be actual migration and not something else, but I had there a shared file with table names that migration tool thought to be migration. By removing that file bug resolved.
Maybe I we could somehow include non-migration files in migration folder or highlight that info in docs if not already present that every file file in migration folder is must be migration and not something else.
Describe the feature you'd like to see implemented
Describe why you would like this feature to be added to Sequelize
More programmatic access to migrations with .sequelizerc
Is this feature dialect-specific?
Would you be willing to resolve this issue by submitting a Pull Request?
Indicate your interest in the addition of this feature by adding the 👍 reaction. Comments such as "+1" will be removed.
The text was updated successfully, but these errors were encountered: