Replace tenant UUID by gen_random_uuid() in pg migration.

This should have been part of 5fd57de6ce7e5682a6b8e908acd28510cd4ba550.
This commit is contained in:
Orne Brocaar 2025-04-15 13:41:41 +01:00
parent 0ae1294a63
commit 7597bcaabf
2 changed files with 14 additions and 5 deletions

View File

@ -63,7 +63,7 @@ insert into "tenant" (
max_gateway_count,
private_gateways
) values (
'52f14cd4-c6f1-4fbd-8f87-4025e1d49242',
gen_random_uuid(),
now(),
now(),
'ChirpStack',

View File

@ -357,10 +357,19 @@ pub mod test {
async fn test_tenant() {
let _guard = test::prepare().await;
// delete default tenant
delete(&Uuid::from_str("52f14cd4-c6f1-4fbd-8f87-4025e1d49242").unwrap())
.await
.unwrap();
// delete existing tenants.
let tenants = list(
10,
0,
&Filters {
..Default::default()
},
)
.await
.unwrap();
for t in &tenants {
delete(&t.id).await.unwrap();
}
let mut t = create_tenant().await;