Created
November 1, 2020 02:15
-
-
Save mbrown3321/6eec2f41afc1c7ed5d2d6a8e700fe9ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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