mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add COLLATE NOCASE on every text content column (names, owners, vendors, device types, MAC addresses, notification titles/bodies/types, event types) so DESC-by-name lists no longer order "iPad" before "Lutron". Normalize MAC addresses to lowercase at the DB layer so the now case-insensitive primary key cannot accept duplicate-looking rows. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
19 lines
510 B
SQL
19 lines
510 B
SQL
CREATE TABLE devices(
|
|
mac_address TEXT PRIMARY KEY COLLATE NOCASE,
|
|
ipv4_address TEXT NOT NULL,
|
|
vendor TEXT COLLATE NOCASE,
|
|
last_seen TEXT NOT NULL,
|
|
is_registered INTEGER NOT NULL,
|
|
owner TEXT COLLATE NOCASE,
|
|
device_type TEXT COLLATE NOCASE
|
|
);
|
|
|
|
CREATE TABLE notifications(
|
|
id INTEGER PRIMARY KEY,
|
|
created_on TEXT NOT NULL,
|
|
notification_type TEXT NOT NULL COLLATE NOCASE,
|
|
title TEXT NOT NULL COLLATE NOCASE,
|
|
body TEXT COLLATE NOCASE,
|
|
is_new INTEGER NOT NULL
|
|
);
|