2014-02-12 12:27:43 -05:00
|
|
|
Sequelize = require("sequelize")
|
|
|
|
Settings = require("settings-sharelatex")
|
2015-05-05 04:47:17 -04:00
|
|
|
_ = require("underscore")
|
|
|
|
|
|
|
|
options = _.extend {logging:false}, Settings.mysql.clsi
|
2014-02-12 12:27:43 -05:00
|
|
|
|
|
|
|
sequelize = new Sequelize(
|
|
|
|
Settings.mysql.clsi.database,
|
|
|
|
Settings.mysql.clsi.username,
|
|
|
|
Settings.mysql.clsi.password,
|
2015-05-05 04:47:17 -04:00
|
|
|
options
|
2014-02-12 12:27:43 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
module.exports =
|
|
|
|
UrlCache: sequelize.define("UrlCache", {
|
|
|
|
url: Sequelize.STRING
|
|
|
|
project_id: Sequelize.STRING
|
|
|
|
lastModified: Sequelize.DATE
|
|
|
|
})
|
|
|
|
|
|
|
|
Project: sequelize.define("Project", {
|
|
|
|
project_id: Sequelize.STRING
|
|
|
|
lastAccessed: Sequelize.DATE
|
|
|
|
})
|
|
|
|
|
|
|
|
sync: () -> sequelize.sync()
|
|
|
|
|