Skip to content
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

Support for Improved Migration Directory Structure and Configuration #1349

Open
mahajanankur opened this issue Jul 16, 2023 · 2 comments
Open

Comments

@mahajanankur
Copy link

Description:
I would like to propose a feature enhancement to support a more flexible and organized migration directory structure in Sequelize, along with improvements in the configuration setup. The current options of using config.js, .sequelizerc, and config.json provide a basic setup but lack the ability to handle complex directory structures and additional migration sources.

Feature Requests:

  1. Nested migration folders: Enable the ability to organize migrations within multiple nested folders based on microservices, releases, or other criteria. This would improve modularity and organization in projects with a large number of migrations.

Sample Directory Structure:

- migrations
  - shared
    - utility
      - <shared_utility_files>.js
    - common
      - <shared_common_files>.js
    - <shared_migration_files>.js
  - microservices
    - <microservice1>
      - <release1>
        - <microservice1_release1_migration_files>.js
      - <release2>
        - <microservice1_release2_migration_files>.js
      - ...
    - <microservice2>
      - <release1>
        - <microservice2_release1_migration_files>.js
      - <release2>
        - <microservice2_release2_migration_files>.js
      - ...
    - ...
  1. Additional migration sources: Allow the specification of multiple migration sources outside the default migrations folder. This would provide flexibility to manage migrations across different directories, enabling better separation of concerns for microservices or modules.

  2. Clear documentation and examples: Enhance the documentation with clear examples and use cases to guide users in setting up and utilizing the advanced migration directory structure and configuration options effectively.

Expected Benefits:

  • Improved organization and scalability for projects with multiple microservices or complex directory structures.
  • Better separation of concerns and modularity in managing migrations.
  • Flexibility in using multiple migration sources, and accommodating diverse project requirements.
  • Greater customization and control over configuration options.
  • Improved developer experience and easier maintenance of migrations.

I believe these enhancements would greatly benefit developers working with Sequelize and enhance the overall migration management experience.

@WikiRik WikiRik transferred this issue from sequelize/sequelize Jul 19, 2023
@WikiRik
Copy link
Member

WikiRik commented Jul 19, 2023

The first two points are planned for the CLI/sequelize-auto rewrite. I'll leave this issue open so we do not forget about it when we work on more of a roadmap for the rewrite

@ephys
Copy link
Member

ephys commented Jul 21, 2023

Migrations are run in a deterministic order based on the name of the file. If we support nested folders or multiple sources of migration files, then that order becomes difficult to understand and easy to break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants