From 54f2a29c19b58db0ab59fc7315a0f2ccdfa67e81 Mon Sep 17 00:00:00 2001 From: Alexis Fourmaux Date: Fri, 8 May 2026 17:12:56 +0200 Subject: [PATCH] fix: add unique constraint to columns that need it --- app/consumer/initdb/01_schema.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/consumer/initdb/01_schema.sql b/app/consumer/initdb/01_schema.sql index 364f1d2..a813e28 100644 --- a/app/consumer/initdb/01_schema.sql +++ b/app/consumer/initdb/01_schema.sql @@ -1,13 +1,13 @@ CREATE TABLE IF NOT EXISTS "device" ( "device_id" UUID NOT NULL DEFAULT uuidv4(), - "device_eui" VARCHAR(255) NOT NULL, + "device_eui" VARCHAR(255) NOT NULL UNIQUE, "site_id" UUID, PRIMARY KEY("device_id") ); CREATE TABLE IF NOT EXISTS "site" ( "site_id" UUID NOT NULL DEFAULT uuidv4(), - "pce" VARCHAR(255) NOT NULL, + "pce" VARCHAR(255) NOT NULL UNIQUE, "address_1" VARCHAR(255) NOT NULL, "address_2" VARCHAR(255), "postal_code" VARCHAR(255) NOT NULL, @@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS "user" ( "user_id" UUID NOT NULL DEFAULT uuidv4(), "name" VARCHAR(255) NOT NULL, "first_name" VARCHAR(255) NOT NULL, - "email" VARCHAR(255) NOT NULL, + "email" VARCHAR(255) NOT NULL UNIQUE, "password_hash" VARCHAR(255), "user_type_id" UUID NOT NULL, PRIMARY KEY("user_id")