mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-25 10:19:04 +02:00
Update Dockerfile for sqlite3, update models for cascade delete, fix backup schedule
This commit is contained in:
parent
254ba1f089
commit
f73a0cce72
20 changed files with 67 additions and 31 deletions
|
@ -32,7 +32,9 @@ module.exports = (sequelize) => {
|
|||
|
||||
static async getOldDeviceByDeviceId(deviceId) {
|
||||
const device = await this.findOne({
|
||||
deviceId
|
||||
where: {
|
||||
deviceId
|
||||
}
|
||||
})
|
||||
if (!device) return null
|
||||
return device.getOldDevice()
|
||||
|
@ -105,7 +107,9 @@ module.exports = (sequelize) => {
|
|||
|
||||
const { user } = sequelize.models
|
||||
|
||||
user.hasMany(Device)
|
||||
user.hasMany(Device, {
|
||||
onDelete: 'CASCADE'
|
||||
})
|
||||
Device.belongsTo(user)
|
||||
|
||||
return Device
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue