What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi, I have a question regarding the IndexGenerator. When we run the IndexGenerator it will create so
Hi, I have a question regarding the IndexGenerator.
When we run the IndexGenerator it will create some schema definition files in Pyz/Zed/IndexGenerator/Persistence/Propel/Schema
where missing indices will be defined.
However when you run the IndexGenerator once again, it will delete those files. I assume this happens, because IndexGenerator will find the indices already exist in the database and hence no additional files are required.
So far we used to put the generated files under version control, but I think there is a misunderstanding on our end.
How is the intended way to use the IndexGenerator? Would it be the intended way to copy the schema files or their content into the specific module folders the files belong to?
Happy about any advice π
Comments
-
If you track your migration files that should not be an issue
0 -
Maybe this helps in your case: https://sprykercommunity.slack.com/archives/CKJRJM5FG/p1636546479106400?thread_ts=1634128564.288500&cid=CKJRJM5FG
0 -
How would tracking migration files help here?
0 -
As far as I understood, the index generator scans the database for missing indexes and creates schema files for them. Once these schema files are created you can create a migration that includes the respective changes that need to get applied to the tables. Once this migration is created you won't need the schema files any more.
If you track the migrations, your good0 -
But when you run the IndexGenerator again, the files will be removed. Hence subsequently generated migration will also delete the indices.
0 -
The Index Generator does not scan the database, but only the schema files. We use it in a CI job, that not even has a running database service.
0 -
The files are removed, because the generated index is already copied/merged to
src/Orm/Propel/MDE/Schema
probably0 -
The files in
src/Pyz/Zed/IndexGenerator/Persistence/Propel/Schema
are also in our repository and are not ignored0 -
My main question is, if the generated files should remain in the folder or moved around.
0 -
They remain in the folder (
src/Pyz/Zed/IndexGenerator/Persistence/Propel/Schema
) in our project. It does not make any difference, sincevendor/bin/console propel:schema:copy
will iterate over all schema files from all modules, merge them and copy the result tosrc/Orm/Propel/MDE/Schema
.0 -
But this folder is excluded from VC by default.
0 -
You mean
src/Orm/Propel/MDE/Schema
?0 -
This makes sense, since these are only generated files, based on what you have in your modules. Think of it as a representation of your database schema on the filesystem.
0 -
Yes and so it does not solve the issue.
0 -
Did you already try the script I posted?
0 -
We had the exact same issue and this is our solution
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 74 Spryker News
- 911 Developer Corner
- 771 Spryker Development
- 87 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 25 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 69 Spryker Safari Questions
- 50 Random