Untitled
unknown
plain_text
2 years ago
600 B
8
Indexable
import {
DataTypes,
Model,
InferAttributes,
InferCreationAttributes,
CreationOptional,
} from 'sequelize';
import db from '.';
class Teams extends Model<InferAttributes<Teams>, InferCreationAttributes<Teams>> {
declare id: CreationOptional<number>;
declare teamName: string;
}
Teams.init({
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
teamName: {
type: DataTypes.STRING,
allowNull: false,
field: 'team_name',
},
}, {
sequelize: db,
modelName: 'teams',
timestamps: false,
});
export default Teams;
Editor is loading...
Leave a Comment