Product articles Database Builds and Deployments

Using a GitHub Tagged Release for a Flyway Migration

Why not just build the latest version of any branch of the database by pulling the scripts from the latest tagged release on GitHub? While it is easy to get the files via the GitHub site, it gets tedious to do so repeatedly, via the GUI. It is, however, possible to automate this via the Rest API, using a script. If you are using PowerShell, I've done it for you. Read more

Moving from application automation to true DevOps by including the database

This article explains the challenges of DevOps automation for databases, starting with how to manage the database, as a set of SQL scripts, in the version control system, and then how to start building an integrated and automated script pipeline for continuously testing and deploying database schema changes, alongside the application code. Read more

Comparing Two SQL Server Databases: When, Why, and How

SQL Compare has a simple premise: it will compare the two SQL Server databases for schema differences. It will generate a script that will make the schema of a target database the same as that of the source database. This article explores all the ways this can be helpful during database development and deployment, from generating database scripts in version control, to detecting database drift, to auto-generating deployment scripts. Read more

Solving the Provisioning Problem in Database Development using Clones

When database development is described, the details often get vague when the data gets beyond spreadsheet-size. There is 'hand-waving' talk of providing databases for each developer, but little detail of how you would provision all the databases that would be needed, at the correct version and with the correct development data, and then keep them all in sync with the source code, as developers commit changes. This article explains the requirements, and how SQL Clone can meet them. Read more

Using Filters to Fine-tune Redgate Database Deployments

Filters are used by Redgate's SQL Compare, SQL Source Control, DLM Dashboard, and SQL Change Automation. A typical use for a filter is to work on just one schema within a database or just a limited set of tables and routines. You would also want to use a filter to exclude certain object, such as database users, from comparisons. Phil Factor explains how they work, and how to create, edit and then use them within the various Redgate tools. Read more

Simple Database Development with SQL Change Automation

SQL Change Automation makes automation simple enough that it can adapt to suit many different approaches to SQL Server database development. Phil Factor describes a project to update the Pubs database, using it in combination with a PowerShell function and to maintain in source control the build scripts, migration scripts and object-level scripts, for every version of the database. Read more

Automating Oracle Database Deployments using the Hybrid Approach

Stephanie Herr explains how to use the 'hybrid' approach in the Deployment Suite for Oracle to automate Oracle database deployments. This is where the team maintains the current state of the database in version control during development. then, at key stages, they generate and test the migrations script that will be used to deploy the new database changes safely. Read more

Allowing for manual checks and changes during database deployments

SQL Change Automation enables users to make database changes to production safely and efficiently using PowerShell cmdlets, which can be integrated easily into any release management tool. This article will show you how to automate database deployments safely, by using SQL Change Automation from within PowerShell scripts, and how a deployment script for a release can be checked and amended as part of the process. Read more

Database Build Breakers: Avoiding Constraint Violations during SQL Server Deployments

A common database build breaker is data that violates the conditions of any of the CHECK, UNIQUE or FOREIGN KEY constraints, and unique non-clustered indexes, designed to protect the consistency and integrity of your data. Phil Factor explain how to avoid this problem, using SQL Compare and some custom stored procedures to discover which rows will cause violations, and fixing them, before running the build. Read more

Deploying Data and Schema Together with SQL Compare or SQL Change Automation

You want to use SQL Compare or SQL Change Automation (SCA) to create or update a database, and at the same time ensure that its data is as you expect. You want to avoid running any additional PowerShell scripting every time you do it, and you want to keep everything in source control, including the data. You just want to keep everything simple. Phil Factor demonstrates how it's done, by generating MERGE scripts from a stored procedure. Read more

Database Build Blockers: Mutually Dependent Databases

Phil Factor demonstrates a clever way to create 'stub' objects, in SQL Change Automation pre-deployment scripts, in order to overcome the problems caused by 'missing objects' when building databases that have circular, or mutual, dependencies. In the subsequent deployment, SQL Change Automation fully builds every object in each of the databases, so all dependencies are fully tested. Read more

Database Delivery with Docker and SQL Change Automation

Phil Factor demonstrates how to integrate SQL Change Automation into containerized workflows, such as are typical of a microservices architecture. He shows how to automate database builds into a Linux SQL Server container running on Windows, and then backup the containerized database and restore it into dedicated containerized development copies for each developer and tester. Read more

Running Linux SQL Server as a Container

Phil Factor starts a series of articles that will demonstrate the use of temporary SQL Server instances, running in Linux containers, into which we can deploy the latest database build, stocked with data, for development and testing work. This initial article shows how to set up a SQL Server instance inside a Linux Docker container, create some sample databases, and persist data locally. Read more

How to reformat a database in one operation

Inherited a database from another team? Changed your team policy on the way that you format SQL? What's to stop you formatting the code of an entire database nicely, when you're developing it? Manually, the process can take longer than you expect. Phil Factor demonstrates a simple 3-step approach to reformatting a whole database , in a single operation, using SQL Compare and SQL Prompt. Read more