Support for user jails

This commit is contained in:
Abhishek Shroff
2024-08-07 21:14:58 +05:30
parent 5ee8ae0f3e
commit dc5268c9dc
24 changed files with 341 additions and 261 deletions

View File

@@ -1,8 +1,8 @@
-- name: CreateUser :one
INSERT INTO users(
username, created, modified, display_name, password_hash
username, created, modified, display_name, password_hash, root, home
) VALUES (
$1, NOW(), NOW(), $2, $3
$1, NOW(), NOW(), $2, $3, $4, $5
) RETURNING *;
-- name: UserByUsername :one
@@ -28,9 +28,11 @@ SET
modified = NOW()
WHERE id = $2;
-- name: UpdateUserHome :exec
-- name: UpdateUserDirs :exec
UPDATE users
SET
home = $1,
root = $1,
home = $2,
modified = NOW()
WHERE id = $2;
WHERE id = $3;