如何在Voyager的Laravel上使用Git? [英] How to use Git on Laravel with Voyager?

查看:88
本文介绍了如何在Voyager的Laravel上使用Git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以使用git来使用管理员Voyager来帮助我吗?例如,如果您需要添加新的内容类型,如何添加git以便将来推送并将其部署在远程服务器上?

Can someone help me using admin Voyager using git? For example, If you need to add new content type, how to add git for future push and deploy it on the remote server?

推荐答案

Git-以及SVN,Mercurial和其他-仅在文件系统上运行.从技术上讲,MySQL和Postgres数据库不是项目文件系统的一部分,因此您不能将这些更改添加到传统的VCS中.

Git - as well as SVN, Mercurial, and others - only operates on the filesystem. MySQL and Postgres databases are not technically a part of your project's filesystem, so you can't add those changes to a traditional VCS.

除了将数据库从MySQL/Postgres更改为SQLite(偶然将存储在项目目录中)之外,Git与数据库无关.

Outside of changing your database from MySQL / Postgres to SQLite (which incidentally is stored as a file in your project directory), Git will have nothing to do with your database.

如果您真正地 想要解决在文件系统上控制数据库版本的麻烦,那么您可以研究以下内容:

If you really want to go through the hassle of keeping your database version controlled on the filesystem, then you can potentially look into the following:

  1. 创建一个要存储的所有内容的MySQL转储.查看 webhooks 以运行命令以在每次推送后导入转储.根据需要更新转储.
  2. 使用迁移和种子来保留数据库快照.查看webhooks以运行适当的artisan命令,以在每次推送后拆除并重新迁移数据库并为该种子播种.根据需要更新种子.
  3. 切换到SQLite.我不知道这是否还能奏效,因为我什至不知道Voyager是否与SQLite兼容.
  1. Create a MySQL dump of everything you want to store. Look into webhooks to run a command to import the dump after every push. Update the dump as necessary.
  2. Use migrations and seeds to keep a snapshot of your database. Look into webhooks to run the appropriate artisan commands to tear down and re-migrate and seed the database after every push. Update your seeds as necessary.
  3. Switch to SQLite. I don't know if this will even work because I don't even know if Voyager is compatible with SQLite.

除此之外,您可能应该研究数据库的部署过程,其中涉及诸如 Capistrano 管理您所需的内容.

Outside of that, you should probably look into a deployment process for your database that involves tools like Capistrano to manage what you need.

这篇关于如何在Voyager的Laravel上使用Git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆