import DataTypes from 'sequelize';

export default (sequelize) => {
    sequelize.define(
        'carModels',
        {
            id: {
                allowNull: false,
                autoIncrement: true,
                primaryKey: true,
                type: DataTypes.INTEGER,
            },
            name: {
                allowNull: false,
                type: DataTypes.STRING,
            },
            yearStart: {
                allowNull: false,
                type: DataTypes.INTEGER,
            },
            yearEnd: {
                allowNull: false,
                type: DataTypes.INTEGER,
            }
        },
        {
            tableName: 'car_models',
            timestamps: true,
        }
    );
};