Flyway Mistakes

I have been doing some testing with Redgate’s Flyway Desktop as a new way of managing code for databases. However, just like Git, I appreciate clients, but I want to know how the CLI (command line interface) works. I spent time learning git add, git push, git checkout and more. Now I have more comfort understanding how SourceTree or GitKraken work.

I wanted to do the same thing with Flyway, just to be sure that I know what the options, switches, and behavior for Flyway operations would be.

The Scenario

I had an existing database, and I wanted to play around with adding this to a DevOps flow. I was looking for a basic experiment, and decided to create a new repo. I copied the default flyway.conf file into this folder and changed it.

The only thing I did was alter the Flyway conf file in my folder to work with SQL Server. I copied the connection string into the flyway.url parameter and set it as follows:

flyway.url=jdbc:sqlserver://aristotle:1433;instanceName=SQL2017;databaseName=AdventureWorks2017;integratedSecurity=true

When I ran the info command, it failed.

fw_fail

When I ran the same command with a different database, it worked:fw_succeed

I was highly confused. I tried a number of different databases, and some of them worked, not I couldn’t see a pattern.

I checked a number of things, including the database owners, a few of which I changed. I thought it might be some permissions and dropped my sysadmin account and added it back.

I tried connecting with SSMS and with sqlcmd. Both of those tools seemed to work.

I was really stumped.

A Small Conflict

Finally, after a bit of back and forth with a few developers, someone noted that I shouldn’t need the port included in the string. Sure enough, when I removed it, things started working.

Apparently, the JDBC documentation notes the issue. I kept looking at Flyway docs, but they just pass things along to the JDBC driver from the various parameters and environment variables.

There is a note that says provide the port number to stop a round trip to the browser to determine the port number for a named instance. If the port number and name are included, the port takes precedence.

I have two instances, some of which have the same databases on each. The databases that worked were on a different instance (which responds to 1433). The ones that didn’t, weren’t on that instance. I kept examining the \SQL2017 instance, but that wasn’t the one I was logging into with my string.

A silly mistake, but a good one to note. The port is a higher priority than the instance in a Java connection string.

I can’t find a priority in the docs for OLEDB or the native client, but they do all say the address takes precedence over the address parameter.

Posted in Blog | Tagged , , | Comments Off on Flyway Mistakes

Daily Coping 21 Mar 2022

I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.

Today’s tip is to stop. Breath. Notice. Repeat regularly.

Yoga has helped me to appreciate this. I will stop and breathe while coaching, especially at tournaments. I’ve used this as I prep to deliver a session as well. Stop, breathe deep, often raise my arms and stretch.

I’ve also found this good for focus, or for trying to relax. I’ve written about box breathing, but today I’m taking a few minutes to breathe and look, rather than think about something specific.

Just breathe, sit, and look out at the world.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 21 Mar 2022

Daily Coping 18 Mar 2022

I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.

Today’s tip is to get outside and notice how the weather feels.

I haven’t done much of this lately. It was cold in Denver for lots of Feb/Mar, and in London I was busy inside, running from place to place. I did like walking a little outside, but the walks were short.

I did, however, get a bit of a walk. The train dropped me off at the West side of the ExCel center. My hotel was about a mile away on the East side. I started to a restaurant to get some food, but since they were not open yet, I decided to walk to the hotel. Rather than going back along the North side of ExCel, where the train was, or inside, I took a slightly longer route along the Thames.

It was a pleasant day, about 50F/10C, a bit of a breeze, but not too bad. I plopped a cap on my head and sunglasses on my face. I walked along, looking at the water and the sites. It was a bit chilly, but invigorating. I had enough clothing to not feel chilled in my core, but the wind and cold air kept me from being too warm.

I breathed deep, enjoying the sensations of a a wonderful day in London, at least mentally. I wouldn’t want to be outside for a long time, but the walk reminded me to appreciate I wasn’t in a rainy (or snowy) London, and I was in London. One of my favorite cities.

As a note, I was in Greenwich and it snowed in London. Another not so great day, but one that I appreciated walking around and enjoyed the chilly weather.

IMG_0909

Posted in Blog | Tagged , , | Comments Off on Daily Coping 18 Mar 2022

Was the Tesla Model Y a Good Decision

This is part of a series that covers my experience with a Tesla Model Y.

As I write this, I’ve owned a Model Y for six months. I’ll do a review of the car ownership across six months, but first, do I think it was a good purchase?

tl;dr yes.

I think the Model Y is a fantastic car and fun to drive. It’s fun, works well in my life, and I still enjoy driving it. In fact, I sometimes make an extra errand trip because I enjoy it.

Comparison with the BMW

Cheap gas is nearly US$4/gal, which is pricey. Filling up the BMW would be US$80 to go a bit over 400 miles. I can’t go 400 miles in the Tesla, but here’s the comparison of 200 miles:

  • BMW: 21mpg, $4.32/gal – $41.14
  • Tesla Model Y, $0.13/kW, 300Wh/mi – $7.80

I used 200 miles as that’s not a bad trip. I can easily do that without charging or without worry. However, given current prices, and what the mileage in a similarly sized car, the Tesla is way cheaper to operate. Plus, for now, my cost is fixed.

Note: I have regularly driven 250 miles in a day without charging.

A few people sometimes point out that I own an X5, whereas I had to buy a Tesla. I’m ignoring the purchase price because I was going to buy a car anyway.

Other EVs

When we first discussed Tesla, I was enamored with the X. I looked at used Xs and priced those against Ys. I decided the Y was a better choice for us, partially because of the newer tech that gets incorporated in them. After reading this article, I think I made a good choice.

The first week I had the Y, I saw a Mach-E at the gym. At first I thought someone had put Mustang badging on a Model Y, but when I walked around it, I realized there are a few differences. There’s a review that I’d urge you to watch if you are comparing them, but based on the review, I think the Model Y is better.

The charging network thing is a big deal to me. In reading and watching others talk, and my own experience in Greeley, I think charging on the road has a ways to go outside of Tesla.

I also think the weirdness of doors, less space, the lack or dual wireless charging, and the infotainment being less tech-y make the Model Y better than the others.

As for the smaller, shorter range cars, I wasn’t really interested.

An Older Sports Car

This whole new car journey started with my wife watching my browse sports car sale listings for weeks. I was thinking to do what my friend Brent did and get an older 944 (or 968).

While I like the idea of one of those cars, I don’t know it would be as fun as this car, certainly wouldn’t be drivable in the snow, and I’d be thinking of the gas cost every time I drove it right now. I’d also potentially have some maintenance things to worry about, and while I could afford them, they seem to occur at bad times for us, financially. And they annoy my wife.

I’m torn on this, though I do think I’ve gotten more enjoyment from nailing the accelerator in the Model Y than I’d get in a sports car. Maybe another 914 that let me whip around turns would be more fun, but not with anyone in the car.

Reviewing the Decision

It was a good decision. As I’ve thought about this, I’m not sure I could have made a better one. The Model S is attractive, but out of my price range, and this car is already fast enough.

I’m still thrilled with my decision.

Posted in Blog | Tagged , | Comments Off on Was the Tesla Model Y a Good Decision