update: use short 16-char hex IDs for new monitors instead of UUIDs

This commit is contained in:
nate 2026-03-18 21:05:01 +04:00
parent e4895afe8e
commit 2075de164d
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ export async function migrate() {
await sql` await sql`
CREATE TABLE IF NOT EXISTS monitors ( CREATE TABLE IF NOT EXISTS monitors (
id TEXT PRIMARY KEY DEFAULT gen_random_uuid()::text, id TEXT PRIMARY KEY DEFAULT encode(gen_random_bytes(8), 'hex'),
account_id UUID NOT NULL REFERENCES accounts(id) ON DELETE CASCADE, account_id UUID NOT NULL REFERENCES accounts(id) ON DELETE CASCADE,
name TEXT NOT NULL, name TEXT NOT NULL,
url TEXT NOT NULL, url TEXT NOT NULL,

View File

@ -20,7 +20,7 @@ export async function migrate() {
await sql` await sql`
CREATE TABLE IF NOT EXISTS monitors ( CREATE TABLE IF NOT EXISTS monitors (
id TEXT PRIMARY KEY DEFAULT gen_random_uuid()::text, id TEXT PRIMARY KEY DEFAULT encode(gen_random_bytes(8), 'hex'),
account_id UUID NOT NULL REFERENCES accounts(id) ON DELETE CASCADE, account_id UUID NOT NULL REFERENCES accounts(id) ON DELETE CASCADE,
name TEXT NOT NULL, name TEXT NOT NULL,
url TEXT NOT NULL, url TEXT NOT NULL,