mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00

shortid is deprecated and they recommend nanoid instead. We're not sure if this has to do with possible name collisions or enumerability, but to be sure and on the safe side, we're changing this. nanoid seems quite safe since it uses node's crypto module underneath. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
18 lines
333 B
JavaScript
18 lines
333 B
JavaScript
'use strict'
|
|
// external modules
|
|
const nanoid = require('nanoid')
|
|
|
|
module.exports = function (sequelize, DataTypes) {
|
|
const Temp = sequelize.define('Temp', {
|
|
id: {
|
|
type: DataTypes.STRING,
|
|
primaryKey: true,
|
|
defaultValue: nanoid.nanoid,
|
|
},
|
|
data: {
|
|
type: DataTypes.TEXT
|
|
}
|
|
})
|
|
|
|
return Temp
|
|
}
|