mirror of
https://github.com/linuxserver/heimdalljs.git
synced 2026-02-20 05:12:24 +08:00
49 lines
887 B
JavaScript
49 lines
887 B
JavaScript
'use strict'
|
|
|
|
const { Model } = require('sequelize')
|
|
|
|
class Item extends Model {
|
|
static init (sequelize, DataTypes) {
|
|
return super.init({
|
|
userId: {
|
|
type: DataTypes.INTEGER
|
|
},
|
|
title: {
|
|
type: DataTypes.STRING,
|
|
allowNull: false
|
|
},
|
|
color: DataTypes.STRING,
|
|
icon: DataTypes.STRING,
|
|
url: {
|
|
type: DataTypes.STRING,
|
|
allowNull: false
|
|
},
|
|
description: DataTypes.STRING,
|
|
active: {
|
|
type: DataTypes.BOOLEAN,
|
|
default: false
|
|
},
|
|
order: {
|
|
type: DataTypes.INTEGER,
|
|
default: 0
|
|
},
|
|
applicationType: {
|
|
type: DataTypes.STRING
|
|
},
|
|
config: {
|
|
type: DataTypes.TEXT
|
|
}
|
|
}, {
|
|
sequelize,
|
|
underscored: true,
|
|
tableName: 'items'
|
|
})
|
|
}
|
|
|
|
toJSON () {
|
|
return this.get()
|
|
}
|
|
}
|
|
|
|
module.exports = Item
|