fix several bugs

This commit is contained in:
DioCrafts
2025-04-10 01:43:25 +02:00
parent 9e73d50a44
commit 5d67bc4d84
19 changed files with 335 additions and 113 deletions
+19
View File
@@ -0,0 +1,19 @@
-- Script to safely reset the admin user in OxiCloud
-- Run this script to delete the existing admin user if you're having issues creating one
-- Set the correct schema
SET search_path TO auth;
-- Delete the admin user if it exists
DELETE FROM auth.users WHERE username = 'admin';
-- Check if the user was deleted
SELECT 'Admin user has been removed successfully. You can now create a new admin user.' AS message
WHERE NOT EXISTS (SELECT 1 FROM auth.users WHERE username = 'admin');
-- Check if there are still users in the system
SELECT 'Warning: No users remain in the system. You should register a new admin user.' AS warning
WHERE NOT EXISTS (SELECT 1 FROM auth.users LIMIT 1);
-- Output remaining users for verification
SELECT username, email, role FROM auth.users ORDER BY role, username;