View from the ski slopes of Arosa. Here for the weekend before a blockchain conference in Davos starting Monday.

Mark Pospesel (Coding and Other Stuff)
Coding, tech, living abroad, travel, hiking, vintage plastic bricks
View from the ski slopes of Arosa. Here for the weekend before a blockchain conference in Davos starting Monday.

Mobile office: having a panache at Zürich main station

Morning mountain. Panorama view from Sattel-Hochstuckli. Beautiful day for a few quick runs. I think I had some sort of breakthrough today: my skiing improved dramatically (still probably not great).

I try to eat healthy but I have a serious craving for gummi bears this afternoon…
Morning mountain. A few runs at Sattel before continuing my work day.

Large swathes of the internet (Atlassian, Harvest, etc) inaccessible from either home internet or cellular here in Switzerland very early this morning. Resolved now but was odd.
When using Core Data I typically rely on automatic lightweight migration to upgrade the persistent store to the latest model version. Today I needed to determine whether the store was migrated.
Creating my persistent store by calling addPersistentStoreWithType:configuration:URL:options:error: with the options to automatically kick off lightweight migration succeeds as long as a migration is possible, but doesn’t indicate when a migration has occurred.
I could just call addPersistentStoreWithType:configuration:URL:options:error: without the migration options, and if that throws an error, then I know I need to migrate. But it turns out there’s a more efficient way to check: simply call isConfiguration:compatibleWithStoreMetadata: on the object model before attempting to open the store.
code snippet:
let metadata = try NSPersistentStoreCoordinator.metadataForPersistentStore(ofType: NSSQLiteStoreType, at: storeURL, options: nil)
if !objectModel.isConfiguration(withName: nil, compatibleWithStoreMetadata: metadata) {
needsMigration = true
}
Reading: Initiating the Migration Process
Tax questionnaire completed! How was your weekend?
And enough procrastinating, time to work on taxes some more…
View from Sattel-Hochstuckli. It’s been too long, but I got back to a mountain today for some skiing. I should go more often. Mountains make me happy and the fresh air and exercise are good for me.
