Category: Blog

  • Creating a Flyway Desktop Shadow Database in PostgreSQL

    In order to generate migrations, we need to configure Flyway to use a shadow database. This post looks at that process.

    This is part of a series of working through Flyway and Flyway desktop to demo database changes. Disclosure: I work for Redgate Software.

    Configuring the Shadow

    This is an empty database where we run the migration scripts to verify them. Since a user might edit or create their scripts, we want to ensure there are no problems with the syntax or execution with other scripts. This is also a place where we keep the “previous state” of your development database and use this to detect the changes you’ve made.

    This database gets cleaned, meaning objects get dropped, regularly, so you configure a space for this. It can be a separate database, or just a schema (more Oracle focused).

    For me. I’m going to create a new database in postgreSQL to support this. As you can see below, I use the simple CREATE DATABASE syntax.

    2023-01-25 14_33_46-Window

    Once I do this, I go back to FWD and click the “Generate Migrations” tab. The first time I do this (and only the first time), it asks me to configure a Shadow database.

    2023-01-25 14_33_27-Window

    I click this and get a connection dialog, similar to what I have for my development database. In here I enter the credentials for my shadow database, which are similar to my development ones. I test the connection and verify I can connect.

    2023-01-25 14_35_03-Window

    That’s it. Now I’m configured for a Shadow.

    The process is similar for other platforms, just with different credentials. If you need to learn more, you can read about this in the documentation.

  • Daily Coping 6 Feb 2023

    Today’s coping tip is to get back in contact with an old friend.

    This is something I don’t do too often, but I have done a few times. I’ve met a lot of great people in my life. Some I worked with, some I encountered in other parts of life. When I go to the UK, I usually see if I can reach out and get the chance to meet someone I know from there for a meal or drink. Which reminds me, I need to reach out to someone and try to make plans for June.

    Around here, I’ve met some really interesting people as a part of coaching. I took time recently to go watch a few kids play that I coached in the past, but haven’t seen in some time. I also sat down with a parent who became a friend, but someone I haven’t seen in a few years.

    Always good to see friends, and worth making the time.

    I started to add a daily coping tip to the SQL Server Central 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.

  • Tesla Charging Experiences

    Recently we had the need to charge the car away from home, with some interesting experiences. I also had a question from my Mom on the Tesla.

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

    A Long Day

    We had a ski weekend planned in the mountains recently. I went up early one Saturday with one kid, who drove his fun WRX. His first time heading into the mountains, and I think the first time he’s driven us to ski in his car.

    My wife had a horse class that day, so she drove the Model Y up north, going about 60 miles each way. I’d set the car to charge to 95% the night before, but her round trip ate up some battery, and as a result, she stopped partway on the journey to charge. She added 18kWh.

    She and my oldest grabbed some food, walked dogs, and didn’t find it a problem to charge, spending about 13 minutes connected.

    Winter Struggles

    The next day, she ran some errands in the mountain town and noticed the car was down to about 30%. She stopped at the Supercharger in Silverthorne, finding only one stall open. When she plugged in the car, it recognized the charger, but didn’t charge.

    She tried a few things, but gave up. She was slightly annoyed, and didn’t want to wait to try another charger when someone left.

    Between her driving and the cold, we lost about 8% of charge in subzero temps. Some of this was thermal protection, and some was likely additional inefficiency of the battery in very cold weather.

    Getting Home

    The next morning, we woke up with 17% on the battery. I started the heaters to warm the car as we packed, as well as get the battery ready. We drove over to charge, stopping for coffee.

    In 32minutes we added 42kW to the battery, which was more than we needed to get home, but it was what the planner recommended. Since we were chatting, handling some email, and drinking coffee, we weren’t that hurried. I might have stopped around 60% charge, but we let his get up to 72%.

    The drive home was easy, and I had plenty of charge to run to the gym and a few errands later.

    Charging Time

    I chatted with my Mom about this a bit, as she’s curious. She has no interest in trading her Lexus for a Tesla, but she asks about how it works and how we deal with it. She hears a lot of FUD in the news about electric cars.

    Here are our charging stats for 16 months.

    2023-02-01 17_04_40-Charging Stats - Grafana — Mozilla Firefox

    My life supports charging at home, and the driving profile for me is that we almost never need 300 miles of range. Even a ski trip is about 220miles for me, so the car has plenty of range. I don’t tend to worry about it, and even on the ski trips, I don’t know if I can go up and back on a cold day with a full charge. I rarely charge about 95% and on ski days, I stop for 15 minutes to use the restroom, get coffee, and let the car charge.

    In general, I just don’t think about charging the car. I have on trips, but I’ve also had to think about fuel on trips. We drive through Wyoming and Montana at times, and we usually fill petrol cars up when they’re 1/2 empty. We do this because the fuel is not as reliable in remote places.

    The mountains of Colorado aren’t remote, but long trips require a little planning, and I don’t find that onerous.

    I also just don’t think about range because I have a (mostly) full tank every day. With my gas/diesel cars, there are plenty of times we’ve run down the tank and have to plan a gas stop that day. I almost never do that with the Model Y.

    I probably wouldn’t have written this post if not for the conversation with my Mom. While the charger not working was mildly a hassle, it was a 3 minute conversation with my wife, not something that was concerning.

    For most people, electric works find. However, it is a different paradigm, and you should think about your lifestyle and driving profile. It’s not for everyone, but it is for me, and I really enjoy the car.

  • Daily Coping 3 Feb 2023

    Today’s coping tip is to ask other people about things they’ve enjoyed recently

    I asked the question on Twitter and on Facebook, looking for interesting responses from friends. The more fun ones:

    • Got a dog (love this!)
    • tabletop gaming
    • cooking a meal with a kid (love the kids around the kitchen)
    • woodworking
    • bought running shoes (I can relate)

    For me, I think a couple quiet dinners out with my wife were very enjoyable. I cook a lot at home, and we often have our kids with us. Date nights have been rare lately, so these were nice.

    I started to add a daily coping tip to the SQL Server Central 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.