From 30900b963c043939caa4492aca6d130843e048d0 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Sat, 18 Mar 2023 09:14:43 +0300 Subject: auth: resources: Disallow duplicate resource names. --- migrations/auth/20221110_01_WtZ1I-create-resources-table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'migrations') diff --git a/migrations/auth/20221110_01_WtZ1I-create-resources-table.py b/migrations/auth/20221110_01_WtZ1I-create-resources-table.py index 0b769b8..abc8895 100644 --- a/migrations/auth/20221110_01_WtZ1I-create-resources-table.py +++ b/migrations/auth/20221110_01_WtZ1I-create-resources-table.py @@ -12,7 +12,7 @@ steps = [ CREATE TABLE IF NOT EXISTS resources( group_id TEXT NOT NULL, resource_id TEXT NOT NULL, - resource_name TEXT NOT NULL, + resource_name TEXT NOT NULL UNIQUE, resource_category_id TEXT NOT NULL, PRIMARY KEY(group_id, resource_id), FOREIGN KEY(group_id) REFERENCES groups(group_id) -- cgit v1.2.3