Morning mountain. A few runs at Sattel before continuing my work day.
Author: Mark
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.
Must do taxes…
I can procrastinate no longer. It is time to fill out the tax questionnaire for 2018…
International Blockchain Forum
Very educational and inspirational day at International Blockchain Forum. So many interesting projects people are working on.
Happy Valentine’s Day!
For Valentine’s Day I’m attending the (free) International Blockchain Forum: Social Impacts and Applications. https://www.hslu.ch/en/lucerne-school-of-information-technology/calendar/events/2019/02/14/blockchain-forum/
The war on chocolate
This may or may not have anything to do with my current war on chocolate.