Nukiana/Upgrade.md

73 lines
3.2 KiB
Markdown
Raw Normal View History

2019-05-03 16:16:15 +02:00
## 03.05.2019
Updated Smartlock and SmartlockLog
##### SQL Update
```
ALTER TABLE Smartlock ADD COLUMN `adminPinState` INT NOT NULL AFTER `accountId`;
ALTER TABLE Smartlock ADD COLUMN `capabilities` INT NOT NULL AFTER `buttonEnabled`;
ALTER TABLE Smartlock ADD COLUMN `ringToOpenTimer` INT NOT NULL AFTER `pairingEnabled`;
ALTER TABLE Smartlock ADD COLUMN `operatingMode` INT NOT NULL AFTER `name`;
ALTER TABLE SmartlockLog ADD COLUMN `deviceType` BOOLEAN NOT NULL AFTER `date`;
ALTER TABLE SmartlockLog ADD COLUMN `flagGeoFence` BOOLEAN NOT NULL AFTER `deviceType`;
```
2019-04-26 20:55:48 +02:00
## 26.04.2019
Updated Bridge things
##### SQL Update
```
ALTER TABLE BridgeList ADD COLUMN `mode` INT NOT NULL AFTER `batteryCritical`;
ALTER TABLE BridgeLockState ADD COLUMN `mode` INT NOT NULL AFTER `batteryCritical`;
ALTER TABLE BridgeInfo ADD COLUMN `deviceType` INT NOT NULL AFTER `currentTime`;
```
2018-12-11 14:46:08 +01:00
## 11.12.2018
Added hardwareVersion Information
##### SQL Update
```
TRUNCATE TABLE Smartlock; /*needs to be truncated - otherwise column mod is not possible*/
ALTER TABLE Smartlock MODIFY `firmwareVersion` INT NOT NULL;
ALTER TABLE Smartlock ADD COLUMN `hardwareVersion` INT NOT NULL AFTER `fobPaired`;
```
2018-11-30 00:52:59 +01:00
2018-11-30 00:53:55 +01:00
## 30.11.2018
* Nuki Smartlock Firmware 67330 -> 67331 (checked @ 30.11.2018)
* Nuki Bridge Firmware 1.11.3 -> 1.11.4 (checked @ 30.11.2018)
* Nuki Bridge WiFi Firmware 1.2.0 -> no change
2018-11-30 00:52:59 +01:00
2018-11-30 00:53:55 +01:00
##### SQL Update
2018-11-30 13:05:32 +01:00
```
ALTER TABLE SmartlockLog ADD COLUMN `List` VARCHAR(24) FIRST;
ALTER TABLE SmartlockAuth ADD COLUMN `accountUserId` VARCHAR(24) FIRST;
ALTER TABLE SmartlockAuth ADD COLUMN `allowedFromDate` DATETIME NOT NULL AFTER `accountUserId`;
2018-11-30 14:16:36 +01:00
ALTER TABLE SmartlockAuth ADD COLUMN `allowedFromTime` SMALLINT AFTER `allowedFromDate`;
2018-11-30 13:05:32 +01:00
ALTER TABLE SmartlockAuth ADD COLUMN `allowedUntilDate` DATETIME NOT NULL AFTER `allowedFromTime`;
2018-11-30 14:16:36 +01:00
ALTER TABLE SmartlockAuth ADD COLUMN `allowedUntilTime` SMALLINT AFTER `allowedUntilDate`;
2018-11-30 13:05:32 +01:00
ALTER TABLE SmartlockAuth ADD COLUMN `allowedWeekDays` SMALLINT NOT NULL AFTER `allowedUntilTime`;
2018-12-02 14:20:33 +01:00
/*delimeter is set to ++ to use this script in DBVisualizer*/
2018-11-30 15:41:37 +01:00
DROP FUNCTION IF EXISTS DaysFromBitMask;
@delimiter ++;
CREATE FUNCTION DaysFromBitMask (val INT)
RETURNS VARCHAR(255) DETERMINISTIC
BEGIN
DECLARE DAY_RESULT VARCHAR(255);
SET DAY_RESULT="";
IF val = 0 THEN SET DAY_RESULT='Keine'; END IF;
IF val >= 64 THEN SET DAY_RESULT='Mo'; SET val=val-64; END IF;
IF val >= 32 THEN SET DAY_RESULT=CONCAT('Di',', ',DAY_RESULT); SET val=val-32; END IF;
IF val >= 16 THEN SET DAY_RESULT=CONCAT('Mi',', ',DAY_RESULT); SET val=val-16; END IF;
IF val >= 8 THEN SET DAY_RESULT=CONCAT('Do',', ',DAY_RESULT); SET val=val-8; END IF;
IF val >= 4 THEN SET DAY_RESULT=CONCAT('Fr',', ',DAY_RESULT); SET val=val-4; END IF;
IF val >= 2 THEN SET DAY_RESULT=CONCAT('Sa',', ',DAY_RESULT); SET val=val-2; END IF;
IF val >= 1 THEN SET DAY_RESULT=CONCAT('So',', ',DAY_RESULT); SET val=val-1; END IF;
/*Wenn val nicht mit "Keine" oder mit "Mo" endet, dann das Komma+Leerzeichen abschneiden*/
SET DAY_RESULT = CASE WHEN DAY_RESULT LIKE '%, ' THEN LEFT(DAY_RESULT,length(DAY_RESULT)-2) ELSE DAY_RESULT END;
RETURN DAY_RESULT;
END
++
@delimiter ;++
GRANT EXECUTE ON FUNCTION DaysFromBitMask TO nuki;
2018-11-30 13:05:32 +01:00
```