Sindbad~EG File Manager
module.exports = (sequelize, DataTypes) => {
const Vehicle = sequelize.define(
"tblVehicle",
{
vehicle_id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
vin: {
type: DataTypes.STRING,
},
year: {
type: DataTypes.INTEGER,
allowNull: false,
validate: {
notNull: {
args: true,
msg: "The year cannot be null",
},
},
},
make: {
type: DataTypes.STRING,
allowNull: false,
validate: {
notEmpty: {
args: true,
msg: "Please provide a make",
},
notNull: {
args: true,
msg: "The make cannot be null",
},
},
},
model: {
type: DataTypes.STRING,
allowNull: false,
validate: {
notEmpty: {
args: true,
msg: "Please provide a model",
},
notNull: {
args: true,
msg: "The model cannot be null",
},
},
},
trim: {
type: DataTypes.STRING,
allowNull: true,
},
imageUrl: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: "preview.png"
},
mileage: {
type: DataTypes.INTEGER,
allowNull: true,
},
color: {
type: DataTypes.STRING,
allowNull: true,
},
color_name: {
type: DataTypes.STRING,
defaultValue: "Black",
},
details: {
type: DataTypes.TEXT,
allowNull: true,
},
user_id: {
type: DataTypes.INTEGER,
allowNull: false,
validate: {
notNull: {
args: true,
msg: "The user_id cannot be null",
},
},
},
},
{
timestamps: true,
}
);
return Vehicle;
};
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists