# direct_delivery stored procedures

## updating a stored procedure
To update a stored procedure, 
    
1. find the corresponding xml for that procedure in this directory. If there is none, see the section below.
1. Increment the id attribute and change the author attribute of the changeSet element.
1. Copy the current declaration to the rollback element.
1. Update the sql element declaration with whatever changes you have.

## importing reference declarations

Many stored procedures haven't been altered in many years, predating the adoption of liquibase. The declarations for
these stored procedures may be found in the "reference" subdirectory of this directory. To modify a stored procedure
that only appears in the reference directory:

1. Create a new xml changeset file (by copying an existing one, typically).
2. Update the id attribute to "1" and the author attribute of the changeSet element.
3. Copy the old declaration from the reference sql into the rollback element. You will need to make some formatting adjustments:
    1. Add a `USE direct_delivery` statement.
    1. Add a `DROP` statement for the procedure.
    1. Replace the delimiter to be `;;`
4. Paste that declaration into the sql element and make whatever modifications are necessary.
5. Make sure to test both the update and the rollback before putting into production.




