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

Fix initial DB seeding script #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

lanseg
Copy link
Contributor

@lanseg lanseg commented Jul 23, 2024

Now an initial setup sql doesn't create orders, orders could be generated by the script from README.

The first run looks like this (default task will be changed in the further commits):
image

@lanseg lanseg requested review from marionb and danduk82 July 23, 2024 08:09
@marionb marionb mentioned this pull request Jul 23, 2024
Copy link
Member

@marionb marionb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lanseg This will only improve the ordere, but it will still mess up the sequence that is used for the generation of the ID of all the other tables like data_format, pricing and so on.
Now when we try to add/configure something in the shop this will end in an primary key error.

My idea was to create a dump with the whole data structure of a DB that is working and import it directly in the shop DB so that we have a working config with some test data. This would also avoid issues when running things twice.

alternatively you could update all the sequences.

Now initial setup contains two simple orders, with one and with two items and
the README contains better and easier to use snippets.
@lanseg lanseg requested a review from marionb July 23, 2024 09:17
@marionb
Copy link
Member

marionb commented Jul 24, 2024

The data you add will still cause the sequences in the DB and the rest of the data of the shop to be in an odd state. With this it will not be possible to add any new data in the shop going through the Django API.

If that is OK for you we can leave it but I think it would be better to have clean data.

Eventually we will have to clean up the DB if we want to test the whole chain with the geoshop FE and BE.

lanseg pushed a commit that referenced this pull request Aug 15, 2024
…151d70723e5

[Snyk] Security upgrade idna from 3.4 to 3.7
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

Successfully merging this pull request may close these issues.

2 participants