Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autogenerate db script for deploying db functions and procedures #355

Merged
merged 42 commits into from
Apr 9, 2024

Conversation

HenningNormann
Copy link
Contributor

@HenningNormann HenningNormann commented Mar 18, 2024

Description

Suggested short term deploy enhancement for functions/procs.

Rules:

  • Each function/proc has a separate file in the Migration/FunctionsAndProcedures folder.
  • After build the tool DbTools.exe is automatically run to generate vx.xx/ZZ-functions-and-procedures.sql based on the content in all files with a newer last changed timestamp than the created timestamp of the newest vx.xx folder. ZZ is assumed to be 01 if no other file is found with another number. (Makes it possible to deploy other stuff before procs/funcs.)
  • The file name is the base proc/function name without any version postfix. The same filename is kept if the proc/func gets a new version.
  • Any drop commands must be coded at the top of the func/proc file or in a separate file in the related v.x.xx folder.
  • A new vx.xx folder must be created when a func/proc is created/updated after last deploy. If not the current vx.xx will be used, and the migration will not be executed by yuniql.

Fixed bug for updating substatus (lacked setting update properties for description and label)

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Copy link
Contributor

@acn-sbuad acn-sbuad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎈
How do we best communicate the new routine? Should we add a readme to the Migration folder for instance?

Copy link

sonarqubecloud bot commented Apr 9, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 65%)
0.0% Condition Coverage on New Code (required ≥ 65%)

See analysis details on SonarCloud

@HenningNormann HenningNormann merged commit 7908c0b into main Apr 9, 2024
8 of 9 checks passed
@HenningNormann HenningNormann deleted the feature/db-autogenerate-scripts branch April 9, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants