feat: db tables and repo and service written
This commit is contained in:
50
server/src/models/wifiLocationHistory.ts
Normal file
50
server/src/models/wifiLocationHistory.ts
Normal file
@ -0,0 +1,50 @@
|
||||
import { DataTypes, Model } from "sequelize";
|
||||
import { sequelize } from "../database/database";
|
||||
|
||||
export class WifiLocationHistory extends Model {
|
||||
public wifi_location_history_id!: string;
|
||||
public mac!: string;
|
||||
public latitude!: number;
|
||||
public longitude!: number;
|
||||
public created_at_utc!: Date;
|
||||
public updated_at_utc!: Date;
|
||||
}
|
||||
|
||||
WifiLocationHistory.init(
|
||||
{
|
||||
wifi_location_history_id: {
|
||||
type: DataTypes.UUID,
|
||||
defaultValue: DataTypes.UUIDV4,
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
},
|
||||
mac: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
latitude: {
|
||||
type: DataTypes.NUMBER,
|
||||
allowNull: false,
|
||||
},
|
||||
longitude: {
|
||||
type: DataTypes.NUMBER,
|
||||
allowNull: false,
|
||||
},
|
||||
created_at_utc: {
|
||||
type: DataTypes.DATE,
|
||||
defaultValue: DataTypes.NOW,
|
||||
allowNull: false,
|
||||
},
|
||||
updated_at_utc: {
|
||||
type: DataTypes.DATE,
|
||||
defaultValue: DataTypes.NOW,
|
||||
allowNull: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
modelName: "WifiLocation",
|
||||
tableName: "wifi_location",
|
||||
timestamps: false,
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user