Stored procedures/DB schema in source control

后端 未结 21 939
孤街浪徒
孤街浪徒 2020-12-04 05:56

Do you guys keep track of stored procedures and database schema in your source control system of choice?

When you make a change (add a table, update an stored proc,

21条回答
  •  [愿得一人]
    2020-12-04 06:48

    The solution we used at my last job was to number the scripts as they were added to source control:

    01.CreateUserTable.sql
    02.PopulateUserTable
    03.AlterUserTable.sql
    04.CreateOrderTable.sql

    The idea was that we always knew which order to run the scripts, and we could avoid having to manage data integrity issues that might arise if you tried modifying script #1 (which would presumable cause the INSERTs in #2 to fail).

提交回复
热议问题