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

Reorganize resources/setup files #22

Closed
colinmollenhour opened this issue Jun 5, 2012 · 4 comments
Closed

Reorganize resources/setup files #22

colinmollenhour opened this issue Jun 5, 2012 · 4 comments

Comments

@colinmollenhour
Copy link

Suggesting to get rid of declared "resources" like "cms_setup" in config.xml and instead use the module name as the resource name, e.g. "Mage_Cms". Then, simplify the directory structure like so:

Before:

  • Mage/Cms/sql/cms_setup/install-1.6.0.0.php
  • Mage/Cms/datal/cms_setup/install-1.6.0.0.php

After:

  • Mage/Cms/setup/schema/install-1.6.0.0.php
  • Mage/Cms/setup/data/install-1.6.0.0.php

I think the above is more intuitive and more consistent with the other changes in Magento 2 vs Magento 1. Also, setup doesn't necessarily have anything to do with sql in all cases (e.g. MongoDb, Lucene, etc..) so "schema" is a better general term. Placing both under a single "setup" directory makes their purpose more apparent and organizes them under one directory since they are closely related.

@mzeis
Copy link
Contributor

mzeis commented Jun 5, 2012

Good proposal, Colin.

@rbrussaard
Copy link

I would like that to.

@therouv
Copy link
Contributor

therouv commented Jun 7, 2012

Makes absolutely sense. And is less confusing than the current implementation in Magento 1.

@magento-team
Copy link
Contributor

Hi Colin,

we have reviewed the changes you proposed, and accepted them. We have formed two user stories out of this proposal.


Module Setup Scripts in Single Folder

As a Magento developer I want to have single location of module's setup scripts within module's directory.

AC:

  • One folder under module's filesystem structure, which groups together all database schema and data setup scripts
  • Module's folder, containing database schema setup scripts, is renamed (for example from sql to schema) in order to better describe its purpose on configuring schema of any type of data storage
  • Subfolders under database and data setup scripts' folders deleted (for example, app/code/core/Mage/Catalog/sql/catalog_setup and app/code/core/Mage/Catalog/data/catalog_setup)

Module Resource Declaration Under Module's Node in Config

As a Magento developer I want to have a clear way to associate all module's resources to a module they belong to.

AC:

  • Module's resource declarations are clearly related to a module by residing under module configuration's xml node
  • All the module's resource declaration nodes do not mention module name explicitly or implicitly

The user stories were added to our backlog. However, feel free to implement them yourself, if you wish to, and submit us a pull request.

Thank you for the proposal.

magento-team pushed a commit that referenced this issue Jan 16, 2015
MAGETWO-32146: Copying and Copyright Year Update
This was referenced Mar 4, 2015
@stevieyu stevieyu mentioned this issue Apr 3, 2015
@FabXav FabXav mentioned this issue Oct 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants