This feature may not be available by default and might need to be enabled upon request. Please contact your account manager for more information.
Git integrations for SqlDBM projects are managed through User Connections. While this article provides specific instructions for Bitbucket, the related article at the end of this post covers the rest of the common steps to configuring the integration.
Once the integration has been configured, see the related at the end of this post on pushing to git and the various ways of generating the files themselves.
To enable version control through the Bitbucket repository, you will need to create an API Token and link it with SqlDBM using the steps below.
Please make sure to initialize your repository by creating at least one file in the main branch (Readme.md for example).
1 . Go to Bitbucket. Create or choose an organization.
2. Create an API token following the steps below:
Go to: Account (1) → Account Settings (2)
Go to Security (1) -> API Tokens / Create and manage API tokens (2)
If prompted for a code, check your email and enter it for the security check.
Next, create an API Token with Scopes (1).
Assign the following scopes to allow creating a branch and, if desired, creating a pull request. (The latter is optional and only required if wanting SqlDBM to create branches and automatically create pull requests.)
Read
read:pullrequest:bitbucket
read:repository:bitbucket
Write
write:pullrequest:bitbucket
write:repository:bitbucket
Once created, make sure to copy the above token. Bitbucket doesn't store it, and you will not be able to see it again.
Note the expiration period. When it expires, the token will no longer be valid, and the integration will break.
3. Open the SqlDBM Account - User Connections - page in a different browser tab.
4. Create or select a User Connection and create an Integration. Choose the "Bitbucket" option.
5. Enter the API Token from the previous step.
6. Username (your Bitbucket/Atlassian registration email)
7. Provide a meaningful label for the repository
8. Provide the repository link.
This can be found on the main repo page. Click Clone (1) and copy the URL highlighted in blue in the below screenshot.
9. Unmark the checkbox if you don't need to create pull requests.
10. Click Connect Integration button.
11. Done.
In a project, select the configured User Connection from the Project Settings or Push to Git button config.
Project users will now see a "Push to Git" button on the Forward engineering page. It will become active after generating DDL or YAML scripts.
The same behavior in the DataOps page (alter script popup).
After a successful push request, find your script in the repository files:
Commits - there should be a commit with your SQL script.
Otherwise, if you selected the 'Create Pull Request' option in the Integration page, go to: Pull Requests