CampFirePlay/models/items.model.js
Degradin b51eebc623 v5.1
Crons, cards, no inventory
2025-01-09 20:06:02 +03:00

41 lines
863 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { DataTypes } = require('sequelize');
const sequelize = require('../db');
const Item = sequelize.define('item', {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
name: {
type: DataTypes.STRING,
allowNull: false,
},
description: {
type: DataTypes.TEXT,
allowNull: false,
},
effectData: {
type: DataTypes.JSON,
allowNull: true
},
price: {
type: DataTypes.INTEGER,
allowNull: false,
},
rarity: {
type: DataTypes.INTEGER,
allowNull: false,
},
type: {
type: DataTypes.STRING, // Тип предмета (например, "инструмент", "ресурс")
allowNull: false,
},
duration: {
type: DataTypes.INTEGER,
allowNull: true
}, // Длительность эффекта в секундах
});
module.exports = Item;