重构后端,改为 node 技术栈
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../config/database');
|
||||
|
||||
const Brand = sequelize.define('Brand', {
|
||||
id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
comment: '品牌 ID',
|
||||
},
|
||||
name: {
|
||||
type: DataTypes.STRING(100),
|
||||
unique: true,
|
||||
allowNull: false,
|
||||
comment: '品牌名称',
|
||||
},
|
||||
}, {
|
||||
tableName: 'brand',
|
||||
comment: '耳机品牌',
|
||||
});
|
||||
|
||||
module.exports = Brand;
|
||||
Reference in New Issue
Block a user