Replace tenant UUID by gen_random_uuid() in pg migration.

This should have been part of 5fd57de6ce.
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, max_gateway_count,
private_gateways private_gateways
) values ( ) values (
'52f14cd4-c6f1-4fbd-8f87-4025e1d49242', gen_random_uuid(),
now(), now(),
now(), now(),
'ChirpStack', 'ChirpStack',

View File

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