#Using an SQL File instead migration
20 messages · Page 1 of 1 (latest)
Why? Migrations are like git for your database, it has many pros.
That's exactly what the schema:dump command does. You just have to put the sql file in database/schemas and name it the same way schema:dump does - then it will be imported at the beginning of the migrate process. Or you could create a migration that runs the import manually.
The project only uses one database and has a small development team that said them don't need table versioning. Just taking up time and maintenance when building the website for each column. 😕
Even to small teams it has a benefit. If there's a new dev, or your PC crashes, how would you set up the project? Exporting a DB from production data? Sharing the files internally to create a DB?
Migrations really are a small investment that has long term benefits. Everyone uses their own local DB, you can quickly pull changes, you can swap systems etc. And as Mono mentioned, you can use a SQL export to start as a "base", from there start using migrations.
If you must have an sql file, keep it out of the Laravel project, and just share it with other ways
I have a 10+ year website that has a database that pre-exists Laravel. Keeping everything in migrations doesn't make sense for us
I don't quite understand the question. If you want to start with a users table only, you only need a users table migration.
Also triggered a little with 'migration for each column' sure, when you want to only add a column to an existing table and not lose the existing data then you'd make a migration but how often in reality does that happen...and even in development if you feel the need to add a column I suspect it's faster to make a migration and run it than go looking somewhere else.. also team can pull that change and migrate rather than each manually update their local environments.. only my 2c
The system is legacy and 11 years old, the Scrum Master pointed out that the migrations were affecting performance, page loading time and programmers' development time.
Honestly, I think migrations are great and I used them in my previous projects. I tried to justify the use with some of the comments available here. But I was unsuccessful.
I'm just a junior, so I don't have much voice or experience to try to argue with the team's decisions :(
Based on this... I need to find a solution that makes the system completely independent of the standard migration format.
As far as I've seen, dump ends up creating migration tables based on a SQL file... I guess?
I actually agree, it was one of the arguments they use. But my request was denied with the argument "The team doesn't have time to learn how migrations work, the system has to be simpler with a language that everyone is already adapted to in the database"
You have a lot of different options here - but your scrum master is not correct - migrations have literally nothing todo with any page load..
Oh.
But yes as mentioned here you can use a db without using migrations - they're just there to make it easier.. but if team prefers to do it by hand then so be it 🙂
Yeah... So be it...
So... Does anyone know how to change the infraestructure of Laravel to just use one file?
Like... Wow I make model adjustments for it
literally this and then create migrations on top, your "scrum master" should try doing some research before saying dumb things