hedgedoc/lib/models/temp.js
Erik Michelson f9bb121522
fix: use nanoid instead of shortid
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>
2025-05-07 17:43:06 +02:00

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
}