feat: Enhance permissions and roles management with improved indexing and state handling

This commit is contained in:
MythEclipse
2025-08-14 23:11:44 +07:00
parent 199d0c885e
commit 10dc869eaf
10 changed files with 134 additions and 171 deletions
@@ -16,7 +16,12 @@ async fn main() -> Result<(), Box<dyn Error>> {
.use_db(env.surrealdb_dbname.clone())
.await?;
db.query("DEFINE INDEX user_email_index ON TABLE users COLUMNS email UNIQUE;")
.await?;
db.query("DEFINE INDEX role_name_idx ON TABLE roles COLUMNS name UNIQUE;")
.await?;
println!("✅ Index 'user_email_index' defined on table 'users' for column 'email'.");
let roles_permissions = vec![