     NSIgnorePersistentStoreVersioningOption         : true,
     NSMigratePersistentStoresAutomaticallyOption    : true,
     NSInferMappingModelAutomaticallyOption          : true,
-    NSPersistentStoreFileProtectionKey              : NSFileProtectionComplete
+    NSPersistentStoreFileProtectionKey              : NSFileProtectionCompleteUntilFirstUserAuthentication
 ]
 
 /**

            
            logInfo(tag) { "Attaching persistent store \"\(storeURL.lastPathComponent ?? "Unknown")\" for type: \(persistentStoreType)."}

            if options?[CCOverwriteIncompatibleStoreOption] as? Bool == true {
                
                let fileManager = NSFileManager.defaultManager()
                
                if let path = storeURL.path where fileManager.fileExistsAtPath(path) {
                    
                    logInfo(tag) { "Checking to see if persistent store is compatible with the model." }

                    let metadata = try NSPersistentStoreCoordinator.metadataForPersistentStoreOfType(storeType, URL: storeURL, options: nil)
                    logTrace(4) { "metadata: \(metadata)" }

                    if !persistentStoreCoordinator.managedObjectModel.isConfiguration(configuration, compatibleWithStoreMetadata: metadata) {
                        
                        logInfo(tag) { "Attempting to remove file \(storeURL) and -shm and -wal files" }
                        
                        try deleteIfExists(fileURL: storeURL)
                        try deleteIfExists(fileURL: NSURL(fileURLWithPath: "\(path)-shm"))
                        try deleteIfExists(fileURL: NSURL(fileURLWithPath: "\(path)-wal"))
                    }
                }
            }
            logInfo(tag) { "Attaching new persistent store \"\(storeURL.lastPathComponent ?? "Unknown")\" for type: \(persistentStoreType)."}
            
            try persistentStoreCoordinator.addPersistentStoreWithType(storeType, configuration:  configuration, URL: storeURL, options: options)

        }
    }
    
    private func deleteIfExists(path: String) throws {
        
        let fileManager = NSFileManager.defaultManager()
        
        if fileManager.fileExistsAtPath(path) {
            
            logInfo(tag) { "Removing file \(path)." }
            
            try fileManager.removeItemAtPath(path)
        }
    }
    
    private func updateFileProtectionIfNeeded(path: String, requiredProtection: String) throws {
        
        logInfo(tag) { "Checking file protection attribute for file \(path)." }
        
        let fileManager = NSFileManager.defaultManager()
        
        if fileManager.fileExistsAtPath(path) {
            
            let currentAttributes = try fileManager.attributesOfItemAtPath(path)
            
            if let currentProtection = currentAttributes[NSFileProtectionKey] as? String {
                
                logTrace(tag, level: 1) { "Current file protection \"\(currentProtection)\"." }
                
                if currentProtection != requiredProtection {
                    
                    logTrace(tag, level: 1) { "Updating file protection to \"\(requiredProtection)\"." }
                    
                    try fileManager.setAttributes([NSFileProtectionKey: requiredProtection], ofItemAtPath: path)
                
                } else {
                    logTrace(tag, level: 1) { "No update required." }
                }
            }
        }
    }
