A project in question contains migration files with following names:
1-addCityToCompany.js
2-addPhonesToCompanies.js
3-addEmailsToCompanies.js
4-addSocialUrlsToCompanies.js
5-addWebstiesToCompanies.js
…
79…
Starting from migration 79, we have created a big fork and development was in separate branch.
It's time to merge and deploy ;)
Now we have 239 migrations and want to apply them all to production database.
The problem is that Sequelize reads migration files, sorted by alphabetical order and it tries to execute migration 100, skipping migration from 80 to 99.
This is a sequence of reading, I suppose Sequelize using ls
for that:
$ ls -1 migrations/
1-addCityToCompany.js
10-addConfirmedAtToUsers.js
100-createPgcryptoExtension.js
101-createRegisterUserFunction.js
102-setupPostgraphileRoles.js
103-createJwtTokenType.js
104-createAuthenticateFunction.js
105-createCurrentUserFunction.js
106-grantPrivileges.js
107-addAvatarFileIdToUsers.js
108-copy_attachments_to_users_avatarFileId_column_where_attachment_name_is_avatar.js
109-createArticleAttachmentTable.js
11-addHeadCompanyIdToCompanies.js
110-copy_attachment_to_articleAttachment.js
111-drop_attachments_table.js
112-grant_privilegies_for_articleAttachments_table.js
113-create_current_user_id_function.js
114-create_createArticle_function.js
115-set_default_values_for_article_timestamps.js
116-add_primary_key_to_articleAttachments.js
117-create_updateArticle_function.js
118-grant_privilegies_on_DELETE_for_articleAttachment_table.js
119-add_country_id_to_jwtToken_type.js
12-addDepartmentsToCompanies.js
120-create_currentCountry_function.js
121-rename_table_articlesComments_to_articleComments.js
122-set_default_values_for_articleComment_timestamps.js
123-create_createArticleComment_function.js
124-enable_rls_for_articleComment_table.js
125-create_policies_for_articleComment.js
126-create_updateArticleComment_function.js
127-create_country_latest_companies_function.js
128-rename_companiesComments_table.js
129-create_country_latest_company_comments_function.js
13-addDepartmentToCompanyCategory.js
130-rename_companiesInfoRequests_table.js
131-create_country_latest_company_info_request_function.js
132-create_country_regions_with_companies_function.js
133-create_region_cities_with_companies_function.js
134-create_country_cities_function.js
135-create_type_department_as_enum.js
136-change_companies_departments_column_type_from_string_to_enum.js
137-change_companyCategories_department_column_type_from_string_to_enum.js
138-create_type_stock_temperature_as_enum.js
139-change_companies_stockTemperatures_column_type_from_string_to_enum.js
14-addDepartmentToPrimaryKeyOfCompanyCategories.js
…
How to control input order of files with Sequelize?