View from the ski slopes of Arosa. Here for the weekend before a blockchain conference in Davos starting Monday.
Month: February 2019
Mobile office, Zürich HB edition
Mobile office: having a panache at Zürich main station
Sattel-Hochstuckli panorama
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).
Gummi bears
I try to eat healthy but I have a serious craving for gummi bears this afternoon…
Morning ski
Morning mountain. A few runs at Sattel before continuing my work day.
Internet outage
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.
How to check whether a Core Data store needs migration
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
Taxes done!
Tax questionnaire completed! How was your weekend?
Tax time…
And enough procrastinating, time to work on taxes some more…
View from Sattel-Hochstuckli
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.