Skip to content

Commit

Permalink
allow for camlized models (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryzettler authored Nov 1, 2023
1 parent 86c3a98 commit c84fbaf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/metadata-service/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ MobileHotspotInfo.init(
},
{
sequelize,
modelName: "mobile_hotspot_infos",
modelName: "mobileHotspotInfo",
tableName: "mobile_hotspot_infos",
underscored: true,
timestamps: false,
Expand All @@ -92,6 +92,7 @@ export class IotHotspotInfo extends Model {
declare country: string;
declare isActive: boolean;
}

IotHotspotInfo.init(
{
address: {
Expand All @@ -110,7 +111,7 @@ IotHotspotInfo.init(
},
{
sequelize,
modelName: "iot_hotspot_infos",
modelName: "iotHotspotInfo",
tableName: "iot_hotspot_infos",
underscored: true,
timestamps: false,
Expand All @@ -125,6 +126,7 @@ export class KeyToAsset extends Model {
declare iotHotspotInfo?: IotHotspotInfo;
declare keySerialization: string;
}

KeyToAsset.init(
{
address: {
Expand All @@ -137,7 +139,7 @@ KeyToAsset.init(
},
{
sequelize,
modelName: "key_to_assets",
modelName: "keyToAsset",
tableName: "key_to_assets",
underscored: true,
timestamps: false,
Expand All @@ -148,6 +150,7 @@ KeyToAsset.hasOne(IotHotspotInfo, {
sourceKey: "asset",
foreignKey: "asset",
});

KeyToAsset.hasOne(MobileHotspotInfo, {
sourceKey: "asset",
foreignKey: "asset",
Expand Down

0 comments on commit c84fbaf

Please sign in to comment.