-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
Only Purge tables that have a fixture class #311
Comments
Hi, can you please help to clearify what kind of feature you're proposing in this issue? I don't really understand your description. As far as I can read, it is about not purging tables, but only for some table rows and not the whole table data? |
Sorry i was not clear. I propose that only tables that the developer has created fixtures for be purged instead of the whole database. Example. I have created a fixtures file and im making changes to Post/Comments/Tags Fixtures knows this as it has the i use fixtures often, every time i generate a new migration that adds a field to my tables i update fixtures and load it. in the current state this means i have to either dump the Users table and then import it after the load. or recreate the user each time. i know i could just create a user fixture and insert the same user every time. but that not ideal. |
My point is also here. BTW, class |
i did not realize this was an option, i will give it a try. either my understanding of the documentation is lacking or more details could be added? sorry im a little retarded so i have great difficulty interpreting most documentation |
there is an option to separate fixtures by groups, but if you use purge option, all the tables will be truncated. I just wrote an suggestion. |
i saw thank you. this will allow me to do what i want. i appreciate your input |
Purging only tables based on the fixture classes is going to be difficult: there’s nothing stopping you from creating multiple different entities in a single fixture class, so the library can’t really know what to clear based on the class. I’m moving this issue to the data-fixtures project, as this is nothing that should be solved in the bundle, but rather in the underlying library. |
Maybe the following idea could be fixable - to add new option |
Perhaps the fact that in the fixture class we obviously if you try to make changes without a use statement you get errors thats just my 10cent. i thank you all for the help. |
Note that currently the purger has no idea of what you’re doing in your fixtures. I’m not saying it’s impossible, but it’s also not something that we can just fix. It definitely requires some thinking as to how to accomplish it. |
of course, being a sub par coder myself i understand this, so the idea is here if you guys ever choose to work on it. im not pushing you to go make the change. Thewind1984 gave me a solution that will work for what i want, but the suggestion still stands if you guys choose to incorporate it in the future |
This is not the first time I would like to have a feature like the one describe here. A common use, is when you have a table for statuses of another table (like "Project" and "ProjectStatus"). When pushing in prod, I need to update the prod ProjectStatus in database values but I just can't load the ProjectStatusFixtures beacause the only two options are :
A solution could be an interface |
So im obviously working on my website and for back end trial and error junk i require user logins to get at admin sections for reasons. it would be nice if instead of a database purge, wiping my 3 users of various permission levels, it would only drop/create tables that fixtures will be working on, as at present i am not creating dummy user data and its a pain to recreate the users each time i reload fixtures.
The text was updated successfully, but these errors were encountered: