Files
LocationHub/server/src/models/lpTtnEndDeviceUplinks.ts

65 lines
1.4 KiB
TypeScript

import { DataTypes, Model } from "sequelize";
import { sequelize } from "../database/database";
export class LpTtnEndDeviceUplinks extends Model {
public lp_ttn_end_device_uplinks_id!: string;
public device_id!: string;
public application_ids!: string;
public dev_eui!: string;
public join_eui!: string;
public dev_addr!: string;
public received_at_utc!: Date;
public battery!: number;
public created_at_utc!: Date;
public updated_at_utc!: Date;
}
LpTtnEndDeviceUplinks.init(
{
lp_ttn_end_device_uplinks_id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
allowNull: false,
},
device_id: {
type: DataTypes.STRING,
allowNull: false,
},
application_ids: {
type: DataTypes.STRING,
},
dev_eui: {
type: DataTypes.STRING,
},
join_eui: {
type: DataTypes.STRING,
},
dev_addr: {
type: DataTypes.STRING,
},
received_at_utc: {
type: DataTypes.DATE,
},
battery: {
type: DataTypes.NUMBER,
},
created_at_utc: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW,
allowNull: false,
},
updated_at_utc: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW,
allowNull: false,
},
},
{
sequelize,
modelName: "LpTtnEndDeviceUplinks",
tableName: "lp_ttn_end_device_uplinks",
timestamps: false,
}
);