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 team, I follow the guide in this link (

U03GZT3EN85
U03GZT3EN85 Posts: 6 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

hi team, I follow the guide in this link (https://docs.spryker.com/docs/scos/dev/setup/installing-spryker-with-docker/installation-guides/installing-in-development-mode-on-windows.html#installing-spryker-in-development-mode-on-windows) to setup b2c demo shop. After setup successfully, I add new table to the DB eu-docker, then add some records but every time I run the command docker/sdk up, the command seems to re-install everything and import the data again, after that the new table and data which I already added above disappear( was removed after run command docker/sdk up)

I wonder whether this is expected default behavior for the b2c demo shop source code or not

I expected the data still persist in database after I run command docker/sdk up

Hope someone can give me some advice

Thanks in advance

Comments

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 โš–๏ธ - Guardians (admin)

    Hey, so expected behaviour imo: Redoing docker/sdk up should not delete the tables and reinsert from scratch.

  • U03GZT3EN85
    U03GZT3EN85 Posts: 6 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    I think so too but not sure why it deletes all the new data after running command docker/sdk up

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 โš–๏ธ - Guardians (admin)

    So are you sure that spryker default tables are disappearing? - I could imagine a file-sync problem:

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 โš–๏ธ - Guardians (admin)

    you touch the schema-files inside the container but they are not properly synched to the host. when you do next time docker/sdk up it will sync from host to guest container without your schema files. Or something similar

  • Alberto Reyer
    Alberto Reyer Posts: 690 ๐Ÿช - Explorer
    1. Tables should not be created manually but managed through Propel Schema definitions (https://docs.spryker.com/docs/scos/dev/back-end-development/zed/persistence-layer/database-schema-definition.html), which will make it persistent
    2. Do you use docker/sdk up --data --build (--data will propergate the data again)? If so, try without --data parameter
  • U03GZT3EN85
    U03GZT3EN85 Posts: 6 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
    edited May 2022

    That is strange. I add manually the new record to the existing table, then run the command docker/sdk up but the new record is still gone

  • U03GZT3EN85
    U03GZT3EN85 Posts: 6 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    I try to comment this command, docker/sdk up again, then the new data is persisted
    So the culprit is this command, am I right?

    command: 'vendor/bin/console propel:tables:drop'
    

    I suppose this command will drop all the table in DB each time docker/sdk up