merged
This commit is contained in:
@ -107,4 +107,6 @@ const sensorModel = sequelize.define(
|
||||
}
|
||||
);
|
||||
|
||||
//sensorModel.belongsTo(locationModel);
|
||||
|
||||
module.exports = { sensorModel };
|
||||
|
@ -48,6 +48,14 @@ const tokenModel = sequelize.define(
|
||||
isIn: [["canRead", "canWrite",]],
|
||||
},
|
||||
},
|
||||
isKey: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
length: 45,
|
||||
validate:{
|
||||
isIn: [["isKey" , "isNotKey"]],
|
||||
}
|
||||
},
|
||||
expiration: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false,
|
||||
|
@ -13,14 +13,16 @@ const sequelize = new Sequelize(
|
||||
dialect: process.env.DB_dialect,
|
||||
storage: process.env.DB_storage,
|
||||
logging: process.env.DB_logging,
|
||||
|
||||
// attributeBehavior?: 'escape' | 'throw' | 'unsafe-legacy';
|
||||
attributeBehavior: 'escape',
|
||||
dialectOptions: {
|
||||
ssl: {
|
||||
ca: fs.readFileSync(path.resolve(__dirname, '../cert/DigiCertGlobalRootCA.crt.pem')),
|
||||
ca: fs.readFileSync(path.resolve(__dirname, '../cert/DigiCertGlobalRootCA.crt_3.pem')),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
sequelize.authenticate().then(() => {
|
||||
|
Reference in New Issue
Block a user