Last active
January 3, 2021 11:11
-
-
Save kasir-barati/61ea22100a56855ad6396e0fbd89c6ca 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
const { DataTypes, Model } = require("sequelize"); | |
const sequelize = require("../sequelize"); | |
class Order extends Model { | |
static col = { | |
id: "id", | |
name: "name", | |
}; | |
static alias = { | |
payment: "OrderPayment", | |
}; | |
} | |
Order.init( | |
{ | |
[Order.col.id]: { | |
type: DataTypes.UUID, | |
primaryKey: true, | |
defaultValue: DataTypes.UUIDV4, | |
}, | |
[Order.col.name]: DataTypes.STRING, | |
}, | |
{ | |
sequelize: sequelize.getSeq(), | |
} | |
); | |
module.exports = Order; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment