mirror of
https://github.com/linuxserver/heimdalljs.git
synced 2026-02-20 05:12:24 +08:00
Remove item-user relationship since we are refactoring this
This commit is contained in:
parent
b46c6c206b
commit
aeeaecea60
@ -8,15 +8,6 @@ module.exports = {
|
||||
primaryKey: true,
|
||||
type: Sequelize.INTEGER
|
||||
},
|
||||
user_id: {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: 'users',
|
||||
key: 'id'
|
||||
},
|
||||
onDelete: 'CASCADE'
|
||||
},
|
||||
title: {
|
||||
type: Sequelize.STRING,
|
||||
allowNull: false
|
||||
@ -34,10 +25,6 @@ module.exports = {
|
||||
description: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
active: {
|
||||
type: Sequelize.BOOLEAN,
|
||||
defaultValue: false
|
||||
},
|
||||
order: {
|
||||
type: Sequelize.INTEGER,
|
||||
defaultValue: 0
|
||||
|
||||
@ -5,9 +5,6 @@ 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
|
||||
@ -19,10 +16,6 @@ class Item extends Model {
|
||||
allowNull: false
|
||||
},
|
||||
description: DataTypes.STRING,
|
||||
active: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
default: false
|
||||
},
|
||||
order: {
|
||||
type: DataTypes.INTEGER,
|
||||
default: 0
|
||||
|
||||
@ -30,12 +30,6 @@ class User extends Model {
|
||||
})
|
||||
}
|
||||
|
||||
static associate (models) {
|
||||
this.hasMany(models.Item, {
|
||||
foreignKey: 'user_id'
|
||||
})
|
||||
}
|
||||
|
||||
static get ADMIN () {
|
||||
return ADMIN
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user