Joomla 中的数据库迁移

2022-01-06 00:00:00 database migration php joomla

有没有办法在 Joomla 中使用数据库迁移?我正在寻找一种类似于 Rails 或 Symfony 中的机制.

Is there any way of using database migrations with Joomla? I'm looking for a mechanism like the one found in Rails or Symfony.

每当我的模型发生变化时,我都想对数据库应用更改,例如添加一列,创建新关系,删除一些表,...

I would like to apply changes to the database whenever my model changes, e.g. adding a column, creating a new relationship, dropping some tables,...

在这个问题中,接受的答案似乎是一个很酷的选择,但我不知道是否有特定于 Joomla 的东西.

In this question, the accepted answer seems like a very cool option, but I don't know if there is something specific to Joomla.

谢谢!

推荐答案

如果你想更新你自己组件的数据库架构,你可以参考以下线程:http://forum.joomla.org/viewtopic.php?p=1607199

If you want to update your own component's DB schema you can refer to the following thread: http://forum.joomla.org/viewtopic.php?p=1607199

如果您只需要没有组件的迁移,请查看这些独立的解决方案:

If you need just migrations without components, check these standalone solutions:

  • https://github.com/davejkiger/mysql-php-migrations
  • https://github.com/Billiam/MySQL-PHP-AutoMigrations

相关文章