We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
like code below
import { Application } from 'egg'; export default (app: Application) => { const DataTypes = app.Sequelize; const sequelize = app.model; const attributes = { id: { type: DataTypes.BIGINT, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: null, field: 'id', unique: 'uk_id', }, name: { type: DataTypes.STRING(32), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: 'user name', field: 'name', }, email: { type: DataTypes.STRING(32), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: 'user email', field: 'name', }, createdAt: { type: DataTypes.DATE, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: 'created time', field: 'created_at', }, updatedAt: { type: DataTypes.DATE, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: 'update time', field: 'updated_at', }, }; const options = { tableName: 'user', comment: 'user table', indexes: [{ name: 'uk_name_email', unique: true, fields: [ 'name', 'email', ], }] }; const UserModel = sequelize.define('userModel', attributes, options); return class extends UserModel { static associate() { } }; };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
like code below
The text was updated successfully, but these errors were encountered: