Skip to content

Commit

Permalink
remove sw_version column (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
soson authored Oct 16, 2024
1 parent 29f0c57 commit 7384686
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:
- You are about to drop the column `sw_version` on the `device_inventory` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "device_inventory" DROP COLUMN "sw_version";
1 change: 0 additions & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ model device {
deviceType String? @map("device_type")
version String? @map("version")
software String?
softwareVersion String? @map("sw_version")
macAddress String? @map("mac_address")
serialNumber String? @map("serial_number")
vendor String?
Expand Down
2 changes: 1 addition & 1 deletion prisma/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async function getCreateDevicesArgs() {
managementIp: ip_address,
port: port_number,
software: device_type,
softwareVersion: version,
version,
mountParameters: JSON.parse(parsedTemplate(device)),
source: 'IMPORTED',
};
Expand Down
2 changes: 1 addition & 1 deletion prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function getCreateDevicesArgs(): Promise<Prisma.deviceCreateManyArgs> {
managementIp: ip_address,
port: port_number,
software: device_type,
softwareVersion: version,
version,
mountParameters: JSON.parse(parsedTemplate(device)),
source: 'IMPORTED' as const,
};
Expand Down
6 changes: 1 addition & 5 deletions src/schema/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ export const Device = objectType({
t.string('vendor');
t.string('version', {
resolve: (root) => {
if (root.softwareVersion != null && root.softwareVersion.length > 0) {
return root.softwareVersion;
}

if (root.version != null && root.version.length > 0) {
return root.version;
}
Expand Down Expand Up @@ -729,7 +725,7 @@ export const CSVImportMutation = extendType({
managementIp: dev.ip_address,
port: dev.port_number,
software: dev.device_type,
softwareVersion: dev.version,
version: dev.version,
mountParameters: JSON.parse(parsedTemplate(dev)),
};
}),
Expand Down

0 comments on commit 7384686

Please sign in to comment.