Welcome Guest, Not a member yet? Register   Sign In
Migration or Console?
#1
Lightbulb 

Hello everyone, am new in php frameworks and I have a question. Is it a good practice to always create DBs and tables using migrations, or is it better to use the traditional way (console, phpmyadmin, adminer, pgsql, etc ...)?
Reply
#2

By migrations, you can track the history of changes to the database structure and roll back if necessary.
Reply
#3

I always start a new project using just PHPMyAdmin. If the project is getting more serious I start using migration and at about the same time I put the project under version control on Github so that I have backup and I can use branches. Rarely I catch the correct moment for this, sometimes I am late, sometimes I do it too early. But that's the way I do it.
Reply
#4

Either use a .env file to set it, or an envrionment varia
Reply
#5

Hi, I'm not able to see my DB while working on the website, what should I do?
Reply
#6

(10-08-2021, 12:35 AM)leenajones Wrote: Hi, I'm not able to see my DB while working on the website, what should I do?

What you should do is starting a new thread for your question instead of hijacking an old one that's not relevant to your problem.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#7

Instead of stealing an existing topic that isn't related to your problem, you should start a new one for your question.
Reply
#8

Keep these best practices to keep in mind when embarking on a data-migration initiative:
Determine the project's scope. .
Ensure that the migration plan is compatible with existing policies
Establish a migration time frame.
Validate and test data post-migration.
Audit and document every step of the process.
Reply
#9

I think it's up to you. Some people are used to working in an outdated style. And this may surprise those who work exclusively with migrations.

I think balance isn't the wrong solution. If you're comfortable using PHPMyAdmin and all of that, go ahead. But don't forget that frameworks are constantly changing and updating, so always learn something new.
Reply
#10

For me it's always through migrations these days for a couple of reasons.

1. The way to recreate the database structure is saved with the repo at all times so no risk of losing it or it getting out of sync.
2. Testing - I have a tendency to lean toward full-stack HTTP testing so I need to have the database able to be created during tests.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB