How to use Git on Laravel with Voyager? [closed]

随声附和 提交于 2019-12-12 04:58:40

问题


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?


回答1:


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.

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. 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.

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



来源:https://stackoverflow.com/questions/45827233/how-to-use-git-on-laravel-with-voyager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!