<commit_before>var dbm = require('stex').dbMigrate;
var type = dbm.dataType;

exports.up = function(db, callback) {
  db.createTable('wallets_v2', {
    // core columns
    id:           { type: 'int', primaryKey: true, autoIncrement: true },
    lockVersion:  { type: 'int', notNull: true },
    createdAt:    { type: type.DATE_TIME, notNull: true  },
    updatedAt:    { type: type.DATE_TIME, notNull: true  },
    // update authorization
    updateKey:     { type: type.STRING, length: "255", notNull: true },
    authToken:     { type: type.STRING, length: "255", notNull: true },
    // login columns
    username:     { type: type.STRING, length: "255", notNull: true },
    salt:         { type: type.STRING, length: "255", notNull: true },
    kdfParams:    { type: type.TEXT, notNull: true },
    totpCode:     { type: type.STRING, length: "255" },
    // Data columns
    mainData:     { type: type.TEXT, length:16777216 },
    keychainData: { type: type.TEXT, length:16777216 }

  }, function() {
    db.addIndex('wallets_v2', 'username_unique', ['username'], true, function() {
      db.addIndex('wallets_v2', 'authToken', ['authToken'], true, callback);
    });
  });
};

exports.down = function(db, callback) {
  db.dropTable('wallets_v2', callback);
};<commit_msg>make authToken non-unique<commit_after>var dbm = require('stex').dbMigrate;
var type = dbm.dataType;

exports.up = function(db, callback) {
  db.createTable('wallets_v2', {
    // core columns
    id:           { type: 'int', primaryKey: true, autoIncrement: true },
    lockVersion:  { type: 'int', notNull: true },
    createdAt:    { type: type.DATE_TIME, notNull: true  },
    updatedAt:    { type: type.DATE_TIME, notNull: true  },
    // update authorization
    updateKey:     { type: type.STRING, length: "255", notNull: true },
    authToken:     { type: type.STRING, length: "255", notNull: true },
    // login columns
    username:     { type: type.STRING, length: "255", notNull: true },
    salt:         { type: type.STRING, length: "255", notNull: true },
    kdfParams:    { type: type.TEXT, notNull: true },
    totpCode:     { type: type.STRING, length: "255" },
    // Data columns
    mainData:     { type: type.TEXT, length:16777216 },
    keychainData: { type: type.TEXT, length:16777216 }

  }, function() {
    db.addIndex('wallets_v2', 'username_unique', ['username'], true, function() {
      db.addIndex('wallets_v2', 'authToken', ['authToken'], false, callback);
    });
  });
};

exports.down = function(db, callback) {
  db.dropTable('wallets_v2', callback);
};
{'fraction_non_alphanumeric': 0.1645274212368728, 'fraction_numerical': 0.027226760015558148, 'mean_word_length': 3.1483870967741936, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5206352', 'n_tokens_mistral': 894, 'n_tokens_neox': 853, 'n_words': 206}