How does the database version align with the PHP application?

Asked

Viewed 71 times

2

Work on a project that system versions are incremented manually on semantic model, usually after a sprint a new version is released when a work is merged with the main branch and passes through the routines of CI. And I only have Javascript and PHP programmers available for this project and the database used is Mysql.

Each development cycle may have generated changes in the database or no changes that may be structural (tables, clunas), logical (functions, triggers, procedures) or data (records in tables).

Aligns software releases with the database has proved to be a real challenge because each client represents a database and must be updated individually and the version control of the database is done through a script differentiating the database structure data along with the INSERT/UPDATE/DELETE commands of the records, as suggested in this question: How to Versize mysql database?.

The main disadvantage of this technique is that it is only possible to advance the version, the rollback is not possible it would be interesting to "return" or "advance" between versions, with possibility of a rollback if the version presents an instability in a particular client.

The expected behavior was the application’s autonomy from updating or regressing the version to apply the necessary changes in the bank. For example, a field has been added or a modified Trigger, the application itself already applies this change according to the update.

In a project where only php programmers were available, and the database is mysql, which framework, tool or methodology is available in the market to create a version of the database along with the application?

  • 1
  • 1

    Yes, before this automatic tool we used the answer technique https://answall.com/a/188/7130, but it became more expensive than the model that uses software to compare the structure I mentioned in the question. Thanks for reminding, I’ll quote you on the question.

  • What is very common to find is a "Migrator" but they are not in fact version managers, since you cannot perform a rollback in the migration.

  • 1

    You can take a look at http://www.liquibase.org/ is an improvement of Migrations

  • 1

    Take a look at how to use Eloquent without Laravel for your own projects https://siipo.la/blog/how-to-use-eloquent-orm-migrations-outside-laravel (ps: I have not tested)

  • @Guilhermenascimento If today you were to start a project with these predictable scenarios, having only php programmers available to you, what would be the framework/tool/methodology to use to get around this problem?

  • To be honest I can’t say, however currently I work with PHP database alone, I always try to work in a simpler way, usually model the database on tools like Workbench. But every project and every person has a way of working, sometimes what’s good for me won’t be good for you.

  • 1

    Leo, a rather silly suggestion, would be to maybe save the schema together on your GIT server, I’m not sure, depends a lot on the project.

  • Show, gave me some ideas here! I will hardly be able to imply something like this in the current project, but I would like to elaborate a better approach to the next projects.

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.