Some interesting questions. I’ll write more, but a couple of quick answers as I breakfast at Logan.
How do I handle expanding a column? Making it larger?
This is platform and change dependent. For example, if you are expanding a varchar() column from 10 to 20, this is usually a metadata operation in MSSQL. No data gets touched, no rows, the system tables record a new size. This can be instantaneous. There are exceptions where this might take time, but usually this works.
Changing from int to Bigint is different, but I’d follow the split columns pattern and add a new column instead, move data, then drop the old one.
How do I get my organization to adopt better patters?
This deserves a longer answer, but there are two parts: technical and politicial. The technical part is teaching other developers the new patters, using linting to catch issues, and convincing others this isn’t hard and works well.
The political part is getting management to support/enforce this. That can be tricky, but you need to provide business reasons why downtime is a problem and how this addresses the issues, with real numbers: time down, cost savings, revenue lost, etc.
I’ve covered the values in a number of previous posts on the Book of Redgate. Those values came from our founders, Simon Galbraith and Neil Davidson. I am lucky enough, and honored to have known these gentlemen for many years and had the chance to sit and chat with them throughout my time at Redgate. Simon and I still get together periodically even today after 25 years.
In the Book of Redgate, there’s a section about prehistory. In it, there’s this picture and text. Neil and Simon have known each other since they were sixteen, starting a business together after they spent time at university.
Neil stepped away from the company many years ago, for a variety of reasons, and he remained on the board for many years. Simon continued as CEO for a long time and stepped down right after the pandemic. He remains on the board today.
The thing that caught my eye is that they worked together from their 20s until their 40s. I still remember their joint 40th birthday party at the old Redgate office. How many people have you worked with for 20 years?
How many of you have worked for an organization for 20 years?
I guess I’ve worked for SQL Server Central for 25 years, but only some of those were me working for myself. I’ve been with Redgate almost 20 years as a contractor and employee, but I haven’t spent 20 years with anyone outside of my family and Andy Warren.
He and I still talk most weeks, even though we’re not in business together anymore.
Redgate has remained a strong brand and presence in my life and that of many others. Part of that is the longevity of so many employees. We’ve had some ups and downs, but relatively few turnover over the years. More recently, especially in sales, but there are a lot of people who have worked there for more than 10 years.
That’s still amazing to me.
I have a copy of the Book of Redgate from 2010. This was a book we produced internally about the company after 10 years in existence. At that time, I’d been there for about 3 years, and it was interesting to learn a some things about the company. This series of posts looks back at the Book of Redgate 15 years later.
I use ConEmu for my terminal interface. I’m still on Windows 10 at home, and for consistency’s sake, I run this on my Win11 laptop and the home machine. I love it, and it keeps my windows together, so that I can run multiple command prompts.
However.
Sometimes I find myself in this situation. I have a bunch of prompts open, and I’m not sure what is what. I know the current one is one of my Flyway projects, but what about the other 4?
I was flipping through them recently and thought there has to be a better way. As you can see, some have a folder, but some don’t. What I really want is some organization.
I learned I can right click the header and get a menu. Notice the “rename” in here.
I can type a new name then for the tab. I did this for my last (right-most) tab below:
Now I can see where all my tabs are focused. I’ve had a tendency to pop a new tab for a new task, as I sometimes have different things going on as I multi-task, or really, as I wait for someone to respond so I can complete the task in a window.
I wish I had an auto-mapping of some sort that might rename these for certain things, but this works well for now. I usually only have 4-5 open, and if I change the task, it’s easy to rename a tab. I tend to do that when I realize I’m looking for something and the name is wrong.
If you use the Windows 11 terminal, it can run multiple prompt and you can rename them as well, but if you’re still on W10 or lower, think about ConEmu. I’ve loved it for the last 5-6 years and it’s worked well. Plus I can have it slide down from the top if I want.
It’s a small change, but a handy one. Flyway Desktop (FWD) now includes the object history for different schema changes, so as you are evaluating how your changes might fit in with others, or you are trying to determine where something broke, you can see a list of historical changes. This post looks at checking history quickly in FWD.
I’ve been working with Flyway and Flyway Desktop and helping customers improve their database development. This series looks at some tips I’ve gotten along the way.
Checking History
In Flyway Deskop, I can see all of my objects on the Schema Model tab on the right side. Here I’ve selected CustProc in the list, and at the bottom I see the current version of the code. However, if you look where my cursor is, there’s a small clock there.
If I click this, I see a blade pop out with history. On the left, I see the various versions. At the top, I have the uncommitted change I just saved. This is shown as the older version on the left, which is committed in Git. My new changes are on the right, with green shading to highlight what I’ve changed in code.
However, maybe I wonder what was the previous change. If I click the top commit (c398a9d), I see this view. Note the red shading on the left, which are the columns I removed. I also have the green shading on the right, where I’ve added a comment and removed a comma. My commit message is at the top with my name and the time (upper right).
I can flip through the various history iterations of code here, just as I did with Git, but I can do this while I’m doing development work in the same place I’ve capturing changes.
I have a “go to Version Control at the top as well, which opens the VCS tab. Here I can commit the change.
Once I do that, my change appears as a new commit for this object in the history.
AI Sparkle
It can be easy to sometimes see the changes made by a developer and understand them. However, sometimes there are complex changes, or you don’t notice something. Here I’ve got a more complex object history.
In the upper right, there’s an AI sparkle next to the “Explain this change”. If I click that, and have AI features enabled, I get an explanation. I’ve zoomed in to see this at the top.
This is a summary of the changes, which in the chaos of work, can be helpful. I get a quick summary.
I wouldn’t just trust this, but instead this guides me along the code to look at what’s been removed and added, and this summary helps me double check that the code does this, and that I understand it.
Summary
This a small improvement, but one that keeps you focused on the work: what changed. No hunting down the changes in Git or changing somewhere else. This also is easier to see than a git diff for me. It also gives me a quick summary where there are a lot of changes.
If you work with Flyway, update your desktop and give it a try. We would love to hear your feedback.
Flyway is an incredible way of deploying changes from one database to another, and now includes both migration-based and state-based deployments. You get the flexibility you need to control database changes in your environment. If you’ve never used it, give it a try today. It works for SQL Server, Oracle, PostgreSQL and nearly 50 other platforms.