Update modules/database/sql_db.py
Browse files
modules/database/sql_db.py
CHANGED
@@ -45,12 +45,13 @@ def create_user(username, password, role, additional_info=None):
|
|
45 |
'password': password,
|
46 |
'role': role,
|
47 |
'timestamp': datetime.now(timezone.utc).isoformat(),
|
48 |
-
'additional_info': additional_info or {}
|
|
|
49 |
}
|
50 |
|
51 |
container.create_item(
|
52 |
body=user_data,
|
53 |
-
|
54 |
)
|
55 |
logger.info(f"Usuario {role} creado: {username}")
|
56 |
return True
|
|
|
45 |
'password': password,
|
46 |
'role': role,
|
47 |
'timestamp': datetime.now(timezone.utc).isoformat(),
|
48 |
+
'additional_info': additional_info or {},
|
49 |
+
'partitionKey': username # Añadir partition key al documento
|
50 |
}
|
51 |
|
52 |
container.create_item(
|
53 |
body=user_data,
|
54 |
+
enable_cross_partition_query=True
|
55 |
)
|
56 |
logger.info(f"Usuario {role} creado: {username}")
|
57 |
return True
|