ADD - add device passcode protection

This commit is contained in:
smx.pusha
2026-08-09 00:11:49 +02:00
parent 4da63ac142
commit eefe3b5331
13 changed files with 1128 additions and 10 deletions
+33
View File
@@ -208,6 +208,39 @@ local schema = {
},
tableOptions = "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
},
{
name = "sky_phone_device_security",
columns = {
{
name = "device_imei",
type = "CHAR(15) NOT NULL",
characterSet = "ascii",
collation = "ascii_bin",
},
{ name = "passcode_hash", type = "BINARY(32) NOT NULL" },
{
name = "passcode_salt",
type = "CHAR(32) NOT NULL",
characterSet = "ascii",
collation = "ascii_bin",
},
{ name = "passcode_length", type = "TINYINT UNSIGNED NOT NULL" },
{ name = "failed_attempts", type = "TINYINT UNSIGNED NOT NULL DEFAULT 0" },
{ name = "locked_until", type = "BIGINT UNSIGNED NOT NULL DEFAULT 0" },
{
name = "updated_at",
type = "DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP",
},
},
primaryKey = "device_imei",
foreignKeys = {
{
column = "device_imei",
references = "`sky_phone_devices` (`imei`) ON DELETE CASCADE",
},
},
tableOptions = "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
},
{
name = "sky_phone_notes",
columns = {