Skip to content

Instantly share code, notes, and snippets.

@mbrown3321
Created November 1, 2020 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbrown3321/6eec2f41afc1c7ed5d2d6a8e700fe9ff to your computer and use it in GitHub Desktop.
Save mbrown3321/6eec2f41afc1c7ed5d2d6a8e700fe9ff to your computer and use it in GitHub Desktop.
"use strict";
const { Model } = require("sequelize");
module.exports = (sequelize, DataTypes) => {
class uploads extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
static associate(models) {
// define association here
}
}
uploads.init(
{
id: {
type: DataTypes.BIGINT,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
file_name: DataTypes.STRING,
image: DataTypes.BLOB("tiny"),
createdAt: {
allowNull: false,
type: DataTypes.DATE
},
updatedAt: {
allowNull: false,
type: DataTypes.DATE
}
},
{
sequelize,
modelName: "uploads",
timestamps: true
}
);
return uploads;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment