Setting up a PHP web project, the infrastructure

前端 未结 5 535
悲哀的现实
悲哀的现实 2021-01-30 01:45

How can I best set up my PHP (LAMP) development environment so that I have development, staging and production servers. One-\"click\" deployment to any of those, as well as one

5条回答
  •  一向
    一向 (楼主)
    2021-01-30 02:36

    For database changes, we have a directory in the VCS:

    + dbchanges
    |_ 01_database
    |_ 02_table
    |_ 03_data
    |_ 04_constraints
    |_ 05_functions
    |_ 06_triggers
    |_ 07_indexes
    

    When you make a change to the database you put the .sql file into the correct directory, and run the integration script that goes through these directories in order, and import every change into the db.

    The sql files have to have to start with a comment, which is displayed to the user when the integration scripts imports the change, describing what it does. It logs every imported sql file's name to a file, so when you run the script next time, it won't apply the same change again.

    This way, all the developers can simply run the script to get the db up to date.

提交回复
热议问题