Skip to content

Commit

Permalink
Helper method to delete duplicates from SP table
Browse files Browse the repository at this point in the history
Not currently called.
  • Loading branch information
eb1 committed Aug 13, 2024
1 parent 311a011 commit 33b310a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions www/js/models/sql/sourcephrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ define(function (require) {
return deferred.promise();
},

cleanDuplicates = function() {
//DELETE FROM sourcephrase WHERE rowid NOT IN (SELECT min(rowid) FROM sourcephrase GROUP BY spid);
window.Application.db.transaction(function (tx) {
tx.executeSql("DELETE FROM sourcephrase WHERE rowid NOT IN (SELECT min(rowid) FROM sourcephrase GROUP BY spid);");
}, function (err) {
console.log("cleanDuplicates() error: " + err.message);
});
},

SourcePhrase = Backbone.Model.extend({
// default values
defaults: {
Expand Down

0 comments on commit 33b310a

Please sign in to comment.