What are the challenges you face when working across database platforms? Take the survey
Options

Using a new stored proc in a migration script

Hi,

My understanding, is that migration scripts run before the Programmable Objects, so my new stored procedure is not available to my migration script.

I can create the sp in the migration script (or one executed before), but I don't like this duplication of code...
Is there a solution I'm missing?

Regards,

Éric Lamontagne

Best Answer

  • Options
    DanCDanC Posts: 604 Gold 4
    Hi @EricLamontagne

    Ah, I understand and unfortunately, that would require a drastic change to the way SQL Change Automation works and we're moving towards Flyway and Flyway Desktop as part of our Redgate Deploy package for the future of DB Devops so I can't see this feature being implemented for SCA

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

Answers

  • Options
    Hi @EricLamontagne

    In this case you can change the Programmable Objects setting to use ScriptInMigrations 

    https://documentation.red-gate.com/sca/developing-databases/concepts/migrations/programmable-objects

    This will then script the PO's into migration scripts directly, once configured you can delete all the existing programmable objects and then re-generate into migrations


    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

  • Options
    Hi Dan,

    We currently have a pretty large project using SCA and we have all our programmable objects neatly organized. I don't want to change any of this.

    Right now, I have copied :( the necessary code into the migration script manually.
    Having duplicated code at this point is not the end of the world for us event tough it might get out of hand if we keep doing so.

    One suggestion: During the import of changes, new PO could have a checkbox like option where we could choose to put it in the migration script directly instead of the PO folder.

    Regards,

    Éric
Sign In or Register to comment.