Make migrations private

This commit is contained in:
Daniel Gasienica 2018-04-02 17:59:35 -04:00
parent b07c66eaa7
commit 7413b787b6
2 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ const { runMigrations } = require('./run_migrations');
// any expensive operations, e.g. modifying all messages / attachments, etc., as // any expensive operations, e.g. modifying all messages / attachments, etc., as
// it may cause out-of-memory errors for users with long histories: // it may cause out-of-memory errors for users with long histories:
// https://github.com/signalapp/Signal-Desktop/issues/2163 // https://github.com/signalapp/Signal-Desktop/issues/2163
exports.migrations = [ const migrations = [
{ {
version: '12.0', version: '12.0',
migrate(transaction, next) { migrate(transaction, next) {
@ -144,7 +144,7 @@ exports.migrations = [
const database = { const database = {
id: 'signal', id: 'signal',
nolog: true, nolog: true,
migrations: exports.migrations, migrations,
}; };
exports.run = ({ Backbone } = {}) => exports.run = ({ Backbone } = {}) =>
@ -152,7 +152,7 @@ exports.run = ({ Backbone } = {}) =>
exports.getDatabase = () => ({ exports.getDatabase = () => ({
name: database.id, name: database.id,
version: last(exports.migrations).version, version: exports.getLatestVersion(),
}); });
exports.getLatestVersion = () => { exports.getLatestVersion = () => {

View file

@ -1,4 +1,4 @@
const last = require('lodash/last'); const { last } = require('lodash');
const db = require('../database'); const db = require('../database');
const settings = require('../settings'); const settings = require('../settings');