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

        }
    }
    
    private func deleteIfExists(fileURL url: NSURL) throws {
        
        let fileManager = NSFileManager.defaultManager()
        
        if let path = url.path {
            if fileManager.fileExistsAtPath(path) {
                try fileManager.removeItemAtURL(url)
            }
        }
    }

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

            let fileManager = NSFileManager.defaultManager()
            
            if let storePath = storeURL.path where fileManager.fileExistsAtPath(storePath) {
                
                let storeShmPath = "\(storePath)-shm"
                let storeWalPath = "\(storePath)-wal"
                
                if let requiredProtection = options?[NSPersistentStoreFileProtectionKey] as? String {
                    //
                    // If the file protection bit is different than the require protection
                    // type, we reset the protection.
                    //
                    // Note: this must be done before opening the data store either with 
                    //       metadataForPersistentStoreOfType or normally with
                    //       addPersistentStoreWithType.
                    //
                    try updateFileProtectionIfNeeded(storePath,    requiredProtection: requiredProtection)
                    try updateFileProtectionIfNeeded(storeShmPath, requiredProtection: requiredProtection)
                    try updateFileProtectionIfNeeded(storeWalPath, requiredProtection: requiredProtection)
                }
                
                // Check the store for compatibility if requested by developer.
                if options?[CCOverwriteIncompatibleStoreOption] as? Bool == true {
                    
                    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) {
                        
                        try deleteIfExists(storePath)
                        try deleteIfExists(storeShmPath)
                        try deleteIfExists(storeWalPath)
                    }
                }
            }
            
            logInfo(tag) { "Attaching new persistent store \"\(storeURL.lastPathComponent ?? "Unknown")\" for type: \(persistentStoreType)."}
            
            try persistentStoreCoordinator.addPersistentStoreWithType(storeType, configuration:  configuration, URL: storeURL, options: options)
