-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new ability to enable or disable tags for topics
- Loading branch information
Showing
11 changed files
with
101 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const config = require('lib/config') | ||
|
||
const dbReady = require('lib/models').ready | ||
|
||
const Tag = require('lib/models').Tag | ||
|
||
/** | ||
* Make any changes you need to make to the database here | ||
*/ | ||
class SaltearPromises { } | ||
exports.up = function up (done) { | ||
dbReady() | ||
// update all tags to have enabled = true | ||
.then(() => { | ||
console.log(`-- Actualizando tags para que todos tengan enabled = true`) | ||
return Tag.update({}, { enabled: true }, { multi: true }) | ||
}) | ||
.then(() => { | ||
done() | ||
}) | ||
.catch((err) => { | ||
if (err instanceof SaltearPromises) | ||
done() | ||
else{ | ||
console.log('-- Error en migration 2000000000029-add-attr-tags-enabled.js:', err) | ||
done(err) | ||
} | ||
}) | ||
} | ||
|
||
/** | ||
* Make any changes that UNDO the up function side effects here (if possible) | ||
*/ | ||
exports.down = function down(done) { | ||
done(); | ||
}; |