Spaces:
Sleeping
Sleeping
File size: 763 Bytes
a5f4a08 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import sqlite3
import os
# Database path
DB_PATH = os.path.join(os.path.dirname(__file__), "vortex.db")
def set_all_admins():
if not os.path.exists(DB_PATH):
print(f"Error: Database not found at {DB_PATH}")
return
try:
conn = sqlite3.connect(DB_PATH)
cursor = conn.cursor()
# Update all users to admin role for development
cursor.execute("UPDATE users SET role = 'admin'")
conn.commit()
updated_count = cursor.rowcount
print(f"Successfully updated {updated_count} users to ADMIN role.")
conn.close()
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
set_all_admins()
|