This commit is contained in:
2024-01-30 14:44:56 -05:00
98 changed files with 12618 additions and 777 deletions

View File

@ -107,4 +107,6 @@ const sensorModel = sequelize.define(
}
);
//sensorModel.belongsTo(locationModel);
module.exports = { sensorModel };

View File

@ -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,

View File

@ -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(() => {