noidea
This commit is contained in:
parent
c34d052e50
commit
97dc6d222a
@ -1,37 +1,32 @@
|
|||||||
import { Schema, model } from 'mongoose'
|
import {DataTypes} from Sequelize;
|
||||||
import path from 'path'
|
import sequelize from '../config/database'
|
||||||
|
|
||||||
const schema = new Schema<any>(
|
export default = sequelize.define(path.basename(__filename).split('.')[0], {
|
||||||
{
|
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: DataTypes.STRING,
|
||||||
required: true
|
allowNull: false
|
||||||
},
|
},
|
||||||
degree: {
|
degree: {
|
||||||
type: Number,
|
type: DataTypes.INTEGER,
|
||||||
required: true,
|
allowNull: false
|
||||||
},
|
},
|
||||||
percentage: {
|
percentage: {
|
||||||
type: Number,
|
type: DataTypes.INTEGER,
|
||||||
required: true
|
allowNull: false
|
||||||
},
|
},
|
||||||
packaging: {
|
packaging: {
|
||||||
type: Number,
|
type: DataTypes.INTEGER,
|
||||||
required: true
|
allowNull: false
|
||||||
},
|
},
|
||||||
note: {
|
note: {
|
||||||
type: String,
|
type: DataTypes.STRING,
|
||||||
required: false
|
allowNull: true
|
||||||
},
|
},
|
||||||
photo: {
|
photo: {
|
||||||
type: Array,
|
type: DataTypes.ARRAY(DataTypes.STRING), // Assuming photo is an array of strings
|
||||||
required: false,
|
allowNull: true
|
||||||
}
|
}
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
timestamps: true,
|
timestamps: true,
|
||||||
},
|
// Other model options here
|
||||||
)
|
});
|
||||||
|
|
||||||
export default model(path.basename(__filename).split('.')[0], schema)
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user