Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Documentation fix: Provide right examples of data upgrade, and mark some
Browse files Browse the repository at this point in the history
features as implemented.

Fix #126
Fix #127
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111529036
  • Loading branch information
arthurhsu committed Jan 6, 2016
1 parent ae4a328 commit 73beae2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
35 changes: 18 additions & 17 deletions docs/spec/03_life_of_db.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,24 +162,25 @@ function onUpgrade(rawDb) {
// This call is synchronous.
rawDb.dropTable('Progress');

// Add column agent (type string) to Purchase with default value 'Smith'.
var p1 = rawDb.addTableColumn('Purchase', 'agent', 'Smith');

// Delete column metadata from Photo.
var p2 = rawDb.dropTableColumn('Photo', 'metadata');

// Rename Photo.isLocal to Photo.local.
var p3 = rawDb.renameTableColumn('Photo', 'isLocal', 'local');

// Transformations are not supported because of IndexedDB auto-commit: Firefox
// immediately commits the transaction when Lovefield tries to return a
// promise from scanning existing object stores. Users are supposed to do a
// dump and make the transformation outside of onUpgrade routine.
// All async upgrade helpers are supposed to chain one after another.

// DUMP the whole DB into a JS object.
var p4 = rawDb.dump();

return Promise.all([p1, p2, p3, p4]);
// Add column agent (type string) to Purchase with default value 'Smith'.
return rawDb.addTableColumn('Purchase', 'agent', 'Smith').then(function() {
// Delete column metadata from Photo.
return rawDb.dropTableColumn('Photo', 'metadata');
}).then(function() {
// Rename Photo.isLocal to Photo.local.
return rawDb.renameTableColumn('Photo', 'isLocal', 'local');
}).then(function() {
// Transformations are not supported because of IndexedDB auto-commit:
// Firefox immediately commits the transaction when Lovefield tries to
// return a promise from scanning existing object stores. Users are
// supposed to do a dump and make the transformation outside of onUpgrade
// routine.

// DUMP the whole DB into a JS object.
return rawDb.dump();
});
}
```

Expand Down
1 change: 0 additions & 1 deletion docs/spec/08_referential_integrity.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Lovefield Specification

## 8. Referential integrity
NOTE: The following spec is not implemented yet.

### 8.1 Constraint semantics

Expand Down
2 changes: 1 addition & 1 deletion docs/spec/99_postfix.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ details, see [design doc](../dd/02_data_store.md#232-bundled-mode-experiment).
### Advanced Grouping
Support for group by multi columns, ROLLUP, and CUBE equivalent.
Support for ROLLUP and CUBE equivalent.
### Multi-Connection
Expand Down

0 comments on commit 73beae2

Please sign in to comment.