24f4ad53bc 
								
							
								 
							
						 
						
							
							
								
								Use single quotes for identifiers  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								052fb841f6 
								
							
								 
							
						 
						
							
							
								
								Allow database name override in migrations  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								1e04083813 
								
							
								 
							
						 
						
							
							
								
								Support database upgrades in `Database.open`  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								2e4893f4c1 
								
							
								 
							
						 
						
							
							
								
								Clarify implications of introducing new migrations  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								7413b787b6 
								
							
								 
							
						 
						
							
							
								
								Make `migrations` private  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								805031ade8 
								
							
								 
							
						 
						
							
							
								
								Conditionally run post-attachment migrations  
							
							... 
							
							
							
							Introduce placeholder migrations for Backbone models so they never implicitly
run migrations whenever they are `fetch`ed. We prefer to run our migrations
explicitly upon app startup and then let Backbone models be (slightly) dumb(er)
models, without inadvertently triggering migrations. 
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								bfbeedab5c 
								
							
								 
							
						 
						
							
							
								
								Temporarily disable post-attachment migration migrations  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								d9be6a0f94 
								
							
								 
							
						 
						
							
							
								
								Destructure Lodash `require`s  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								1f8556b049 
								
							
								 
							
						 
						
							
							
								
								Remove unused `createCollection`  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								efe3cd67fc 
								
							
								 
							
						 
						
							
							
								
								Allow attachment migration run on higher database version  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								921c3dba7c 
								
							
								 
							
						 
						
							
							
								
								Skip migrations that have already been applied  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								c5c94bc3ab 
								
							
								 
							
						 
						
							
							
								
								Extract `getMigrationVersions`  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								6aea36240d 
								
							
								 
							
						 
						
							
							
								
								Rename `closeDatabase` to `closeDatabaseConnection`  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								016432826b 
								
							
								 
							
						 
						
							
							
								
								Extract `database` and `settings` modules  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								5bea894abd 
								
							
								 
							
						 
						
							
							
								
								Close database connection via Backbone IDB adapter  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								4ff8bc3357 
								
							
								 
							
						 
						
							
							
								
								Use `camelCase` for non-constructors  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								eca930770c 
								
							
								 
							
						 
						
							
							
								
								Remove hard-coded database connection settings  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								178a3cc262 
								
							
								 
							
						 
						
							
							
								
								Reduce work for verifying transaction completion  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								457bf7ab9d 
								
							
								 
							
						 
						
							
							
								
								Add `createCollection` function  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								172616ca4f 
								
							
								 
							
						 
						
							
							
								
								Add log message for dummy migration 18  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								da144edc56 
								
							
								 
							
						 
						
							
							
								
								Manually close database connection after migration  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								106ce21c49 
								
							
								 
							
						 
						
							
							
								
								Remove redundant log message  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								fcd30cd919 
								
							
								 
							
						 
						
							
							
								
								Close database after migration  
							
							... 
							
							
							
							This is not 100% reliable as database connections are closed in a separate
thread according to the documentation:
- https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/close 
- https://stackoverflow.com/a/18639298 
- 80c7a06d5c/backbone-indexeddb.js (L558-L565) 
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								e2f1339ab9 
								
							
								 
							
						 
						
							
							
								
								Explicitly run post-attachment migrations  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								d7c8d33edb 
								
							
								 
							
						 
						
							
							
								
								Extract `runMigrations`  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								d16178638e 
								
							
								 
							
						 
						
							
							
								
								Split database migrations into pre- and post-attachment migration  
							
							... 
							
							
							
							- Run light-weight migrations before attachment migration.
- Run regular migrations after attachments have been moved to disk. 
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								c88381efe3 
								
							
								 
							
						 
						
							
							
								
								Use `async` / `await` to improve readability  
							
							
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								2642844c27 
								
							
								 
							
						 
						
							
							
								
								Rewrite migration 17 without `idb`  
							
							... 
							
							
							
							We ran into issues when doing async operations inside of an IndexedDB
`onupgradeneeded` handler. The errors were ‘The transaction is not active’ or
‘Transaction has finished’. The following documentation confirmed that
transactions are committed/terminated when control returns to the event loop:
Spec
- https://www.w3.org/TR/IndexedDB/#transaction-lifetime-concept 
- https://www.w3.org/TR/IndexedDB/#upgrade-transaction-construct 
Stack Overflow
- https://stackoverflow.com/a/11059085 
- https://stackoverflow.com/a/27338944 
Since the initial database migration is so critical, I decided to avoid `idb`
with promise support for IndexedDB for now, but will reconsider using it for
other tasks in the future to improve readability of IndexedDB code. 
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								5d927b73e6 
								
							
								 
							
						 
						
							
							
								
								Use `while` loop for IDB cursor iteration  
							
							... 
							
							
							
							Previously, I messily combined promises and callbacks because I thought we
were affected by the microtask issue:
https://github.com/gasi/idb#iteratecursor--iteratekeycursor 
ESLint’s `more/no-then` encouraged me to revisit this and it works as expected. 
							
						 
						
							8 years ago  
				
					
						
							
							
								 
						
							
							
								182e6ffe10 
								
							
								 
							
						 
						
							
							
								
								Add version 17 migration  
							
							
							
						 
						
							8 years ago