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 Please let me know whether there is any way in spryker to seed data in database. Like I need to a
Hi
Please let me know whether there is any way in spryker to seed data in database.
Like I need to add some data in database master table.
Is there any way to add that without manually adding data in table?
Comments
-
Yes there is a way, called installers:
You can have a look at
\Pyz\Zed\Installer\InstallerDependencyProvider::getInstallerPlugins
to see plenty of examples on how to implement such an installer that seeds data into the database.
The LocaleInstaller would be a very good and easy example how this is implemented:\Spryker\Zed\Locale\Business\Internal\Install\LocaleInstaller
0 -
ok thanks
I am checking the code, it should work fine.
It seems that this installer is called fromLocaleInstallerPlugin
. and please let me know how can we call this plugin.0 -
setup:init-db
command will execute all installers. As this runs on every deployment in the Spryker PaaS you should ensure that your installer is idempotent, meaning it can run more than once without sideeffects.0 -
and how can I run setup:init-db on my local.
0 -
Like any other command:
docker/sdk console setup:init-db
0 -
ok thanks
Will try to implement the same and will ping if will find any issues during implementation0 -
@UL6DGRULR thanks for your help. I was able to seed data from above command.
0 -
@UL6DGRULR Please let me know whether there is any option in
docker/sdk console setup:init-db
to run only one specific plugin for installer. Currently to proceed with the installer on which I am working, I am commenting remaining plugins.0 -
There is no option to run only a certain installer, but all installers should be idempotent, so running them more than once should not be an issue and there is no need to comment the remaining plugins
0 -
okay. Thanks
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 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
- 70 Spryker Safari Questions
- 50 Random