Skip to content

Make the autoupdate logic much more generic#48

Merged
qpresley merged 2 commits intomasterfrom
genericAutoUpdate
Apr 6, 2017
Merged

Make the autoupdate logic much more generic#48
qpresley merged 2 commits intomasterfrom
genericAutoUpdate

Conversation

@qpresley
Copy link
Copy Markdown
Collaborator

@qpresley qpresley commented Apr 6, 2017

The autoupdate logic was initially built for DB2 only and relied on system catalogs that do not apply to all databases in the IBM set. These changes will make the autoupdate function much more generic and possibly more functionally correct as it ensures the order of operations will not cause issues such as a column of a table being dropped while an index using that column still exists in the database.

While this may not be the most performant version of autoupdate, this is unlikely to be something users do frequently and the rebuilding of the indexes may improve database performance in some cases.

Comment thread lib/migration.js
// Now that the column altering statments have been added we can add in the
// indexes again.
// ------------------------------------------------------------------------
sql = sql.concat(self.buildIndexes(model));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function buildIndexes is missing.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jannyHou buildIndexes is in ibmdb.js

Copy link
Copy Markdown
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kjdelisle
Copy link
Copy Markdown
Contributor

@slnode test please

@qpresley qpresley merged commit 56b795c into master Apr 6, 2017
@kjdelisle kjdelisle deleted the genericAutoUpdate branch April 6, 2017 19:44
kjdelisle pushed a commit that referenced this pull request Jul 12, 2017
 * add test case for fromColumnValue (Diana Lau)
 * fix fromColumnValue when val is undefined (Diana Lau)
 * Remove connection string logging (#50) (Quentin Presley)
 * Make the autoupdate logic much more generic (#48) (Quentin Presley)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants