And "just works" means they can run all of the tests immediately, can add their own tests that will work for everyone else without any custom setup, and the tests never never touch the local development database, potentialy destroying work in progress. I had been asking how to create multiple databases when sail runs in laracasts a few weeks ago, with no answers, then along comes this feature out of the blue :-) I know you can create whatever database you like when working on an application, but what I am always looking for is a standard approach that a new developer on a team can just pull out of the repo, run, and it just works the same way as anyone else's development instance. ![]() Maybe this is a feature that has been available for a while, and I have just not noticed, but the upgrade brought it to my attention.Īlso noticed that laravel sail now creates an additional testing database alonside your main database, which is really cool. In short, use database refresh in the knowledge that it is not as destructive as it used to be. I have one test failing after the upgrade because it used to assume two model instances it created were 1 and 2 because it had a fresh database. Oh, and the autoincrement IDs contimue increaing from one test to the next, showing that the database is not rebuilt. That was not ideal, but okay during development as you can filter down to just the test you are working on.Īfter upgrading to laravel 9, with no other changes, running the whole set of tests seems to tear down and migrate the database once at the start of any test run, then does not do that again - it leaves a blank testing database at the end, implying it uses database sessions to wrap up each test and then roll back anything the test has created at the end. I use database refresh, but in previous versions of the framework that tore down and migrated the database for each test, which was very slow. Even if it is still having to to that same process in the background at least I don't have to keep rewriting that logic and hope I don't mess it up. Part of me wants someone to tell me it's nothing significant and give me permission to switch back to MySQL.Īnd part of me wants someone to show me a tool that can do the work of creating a new table and moving data for me so migrations with custom column ordering is just as simple in Postgres. Part of me truly wants to know what the big deal is and why the DB experts say to use Postgres over MySQL. Or perhaps what would I loose if I decided to migrate to MySQL instead? ![]() So the question is what am I gaining by putting up with not being able to change column order. ![]() And to do so whithout breaking foreign key constraints. Problem is to get that I have to create these crazy migrations that rename a table recreate it with the columns in the order I want them move data to the new table before dropping the old one. Seems simple I know but call me OCD even though it only affects me and only when I'm accessing it in TablePlus I want a logical order to my columns. Why is Postgres better than MySQL?Īfter using Postgres for awhile and having to add to the schema I find myself annoyed by the inability to choose the column order. When I was writing my app I had heard a couple of different DB experts in Laravel related podcasts argue that we should use Postgres over MySQL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |