Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    DB Change Scripts and Releases

    Scheduled Pinned Locked Moved Support
    releaseschange-scriptsbuildmaster
    8 Posts 1 Posters 5 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      We have an application with two active releases: 1.4.1 and 1.5.0. The 1.4.1 release is a hotfix of the already-deployed 1.4.0. We also have a SQL change script attached to the application, and tied to release 1.5.0. However, this morning when we executed a build for the 1.4.1 release, the SQL change script for 1.5.0 was executed. I thought by associating the SQL change script to release 1.5.0, it would NOT execute for release 1.4.1, but only for 1.5.0 (or perhaps later releases). Does this not work the way I think it does, or is there a bug?

      This is what our environments look like right now:

      DEV - 1.5.0 (change script for 1.5.0 executed - good)
      TEST - 1.5.0 (change script for 1.5.0 executed - good)
      QA - 1.5.0 (change script for 1.5.0 executed - good)
      STAGE - 1.4.1 (change script for 1.5.0 executed - not good)
      PROD - 1.4.0 (we haven't promoted anything here yet)

      Product: BuildMaster
      Version: 4.1.1

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        Hi Glen. This is the behavior, but you need to reorder your releases. To do this, go to the all release page, select "all" from the drop down. Then you can click the manage sequence button.

        We are going to get improving the auto sequence for newly created releases in a maintenance release.

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Where is this done? At /applications/{number}/releases/history?

          In my original post I failed to format that list of environments, so here's that:

          • DEV - 1.5.0 (change script for 1.5.0 executed - good)
          • TEST - 1.5.0 (change script for 1.5.0 executed - good)
          • QA - 1.5.0 (change script for 1.5.0 executed - good)
          • STAGE - 1.4.1 (change script for 1.5.0 executed - not good)
          • PROD - 1.4.0 (we haven't promoted anything here yet)

          We've never promoted a build for 1.5.0 to STAGE; we went from 1.4.0 to 1.4.1, so I'm confused as to why a SQL change script for release 1.5.0 would have executed in STAGE.

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            Ok, so I found where to do this, but when I try to reorder the releases, the server returns a "Bad Request" error.

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              hmm... ther emust be a bug somewhere?

              When you refresh page, do releases seemed re-ordered?

              What happens if you drag/drop them in a different way? E.g. 14.1 down vs 15.0 up?

              There is also a API method you can use: [Releases_ResequenceRelease]

              1 Reply Last reply Reply Quote 0
              • ? This user is from outside of this forum
                Guest
                last edited by

                When I refresh the page, the releases are in the original order (i.e., the changes don't "take"). It doesn't matter if I swap 1.4.1 with 1.5.0 or 1.5.0 with 1.4.1.

                I tried reordering releases in another application and it worked fine, so something about this application and these releases is fubar. Maybe BuildMaster doesn't want me to reorder releases given the current state of SQL change scripts?

                1 Reply Last reply Reply Quote 0
                • ? This user is from outside of this forum
                  Guest
                  last edited by

                  That would not impact this; i'm guessing there is some bug somewhere, that caused your release sequences to get messed up?

                  Basically all that release ordering is doing is the following update statement:

                  UPDATE [Releases]
                     SET [Release_Sequence] = CASE
                            WHEN [Releases].[Release_Sequence] = RTAR.[Release_Sequence] 
                                 THEN RPOS.[Release_Sequence]
                            WHEN [Releases].[Release_Sequence] BETWEEN RTAR.[Release_Sequence] AND RPOS.[Release_Sequence]
                                 THEN [Releases].[Release_Sequence] - 1
                            WHEN [Releases].[Release_Sequence] BETWEEN RPOS.[Release_Sequence] AND RTAR.[Release_Sequence]
                                 THEN [Releases].[Release_Sequence] + 1
                            ELSE [Releases].[Release_Sequence]
                            END
                    FROM [Releases],
                         [Releases] RTAR,
                         [Releases] RPOS
                   WHERE [Releases].[Application_Id] = @Application_Id
                     AND RTAR.[Application_Id] = @Application_Id
                     AND RTAR.[Release_Sequence] = @Release_Sequence
                     AND RPOS.[Application_Id] = @Application_Id
                     AND RPOS.[Release_Sequence] = @Replaced_Release_Sequence
                     AND @Release_Sequence <> @Replaced_Release_Sequence
                  

                  Can you look at your releases table to see the sequences?

                  1 Reply Last reply Reply Quote 0
                  • ? This user is from outside of this forum
                    Guest
                    last edited by

                    I went to the Releases table and fixed it by hand, and the sequence is correct now. Thanks.

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • 1 / 1
                    • First post
                      Last post
                    Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation