-- ----------------------------
-- Table structure for alarm_log
-- ----------------------------
UPDATE "alarm_log" SET "alarm_type" = 'CommunicationAlarm' WHERE "alarm_type" = '1';
UPDATE "alarm_log" SET "alarm_type" = 'EquipmentAlarm' WHERE "alarm_type" = '2';
UPDATE "alarm_log" SET "alarm_type" = 'ProcessingFailure' WHERE "alarm_type" = '3';
UPDATE "alarm_log" SET "alarm_type" = 'EnvironmentalAlarm' WHERE "alarm_type" = '4';
UPDATE "alarm_log" SET "alarm_type" = 'QualityOfServiceAlarm' WHERE "alarm_type" = '5';
UPDATE "alarm_log" SET "orig_severity" = 'Critical' WHERE "orig_severity" = '1';
UPDATE "alarm_log" SET "orig_severity" = 'Major' WHERE "orig_severity" = '2';
UPDATE "alarm_log" SET "orig_severity" = 'Minor' WHERE "orig_severity" = '3';
UPDATE "alarm_log" SET "orig_severity" = 'Warning' WHERE "orig_severity" = '4';
UPDATE "alarm_log" SET "orig_severity" = 'Event' WHERE "orig_severity" = '5';
UPDATE "alarm_log" SET "alarm_status" = 'Clear' WHERE "alarm_status" = '0';
UPDATE "alarm_log" SET "alarm_status" = 'Active' WHERE "alarm_status" = '1';
ALTER TABLE "alarm_log" RENAME TO "alarm_log_old";
CREATE TABLE "alarm_log" (
  "id" integer NOT NULL,
  "ne_type" text(16),
  "ne_id" text(64) NOT NULL,
  "alarm_seq" integer(11),
  "alarm_id" text(32),
  "alarm_code" integer(11),
  "alarm_title" text(255),
  "alarm_status" text(64),
  "alarm_type" text(64),
  "orig_severity" text(64),
  "event_time" integer(20),
  "created_at" integer(20),
  PRIMARY KEY ("id")
);

-- ----------------------------
-- Records of alarm_log
-- ----------------------------
INSERT INTO "alarm_log" ("id", "ne_type", "ne_id", "alarm_seq", "alarm_id", "alarm_code", "alarm_title", "alarm_status", "alarm_type", "orig_severity", "event_time", "created_at") SELECT "id", "ne_type", "ne_id", "alarm_seq", "alarm_id", "alarm_code", "alarm_title", "alarm_status", "alarm_type", "orig_severity", "event_time", "created_at" FROM "alarm_log_old";
DROP TABLE IF EXISTS "alarm_log_old";
