Replies: 2 comments 3 replies
-
Next issue that I have is run migration which creates data for new created domain. I need locale that new domain so I called Any idea of right way to prevent this issue? 🙏
|
Beta Was this translation helpful? Give feedback.
-
Hi @sspooky13, I have to admit it is really hard to help you here. I think you are describing 3 different problems... The first one: I have added migrations which is creating
The second and third one: It seems you should either do everything in migration and do not to let everything for I will not probably not anwer to all your question but hope it will help you too. |
Beta Was this translation helpful? Give feedback.
-
Hello,
In one unnamed project, I need to add country to database. So, I created data in migration for tables
countries
,country_domains
,country_translations
. This is ok.Issue is in localhost/CI where after running
db-demo
I have only first domain in migrations becausebaseUrl
insetting_values
exists only for first domain. After running migrations is runningphp phing domains-data-create
where is addednull
to name, so smoke tests throw fatalTypeError: Return value of Shopsys\FrameworkBundle\Model\Country\CountryTranslation::getName() must be of the type string, null returned
on this line. So, I wanted to edit this country in CountryDataFixture class but there is another fatal[Shopsys\FrameworkBundle\Model\Country\Exception\CountryDomainNotFoundException] CountryDomain for country with ID 1 and domain ID 2 not found.
becauseCountryDomain
is created only in construct, not in edit (code try to edit CountryDomain[secondDomainId] and that instance not exists).I solved this issue with native query in data fixtures but I want your opinion on what do you think is right solution? 🙏
Thanks for your time.
PS: I talk about SSFW 8 project, maybe in SSFW 9 this issue not exists (but I don't think it's solved in SSFW 9).
To Reproduce
CountryDataFixture
php phing db-fixtures-demo
Beta Was this translation helpful? Give feedback.
All reactions