mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-15 03:55:53 +00:00
Use a JSON column for metadata
This commit is contained in:
parent
93cd511211
commit
056bb6b0f4
1 changed files with 1 additions and 3 deletions
|
@ -21,13 +21,11 @@ else
|
|||
Event = sequelize.define("Event", {
|
||||
user_id: Sequelize.STRING,
|
||||
event: Sequelize.STRING,
|
||||
metadata: Sequelize.STRING
|
||||
metadata: Sequelize.JSON
|
||||
})
|
||||
|
||||
module.exports =
|
||||
recordEvent: (user_id, event, metadata = {}, callback = (error) ->) ->
|
||||
if typeof(metadata) != "string"
|
||||
metadata = JSON.stringify(metadata)
|
||||
if user_id? and typeof(user_id) != "string"
|
||||
user_id = user_id.toString()
|
||||
if user_id == Settings.smokeTest?.userId
|
||||
|
|
Loading…
Reference in a new issue