Initial commit: homelab configs, Docker, Neo4j, voice control, Gitea
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
"""Verwijder duplicate favorites (ID 11-20)."""
|
||||
import os, sys
|
||||
os.environ["PG_HOST"] = "192.168.1.211"
|
||||
os.environ["PG_PORT"] = "5433"
|
||||
os.environ["PG_USER"] = "mo"
|
||||
os.environ["PG_PASSWORD"] = "WaQTUw2t"
|
||||
os.environ["PG_DATABASE"] = "homelab"
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from src.pg_client import query, execute
|
||||
|
||||
print("Voor opschonen:")
|
||||
rows = query("SELECT id, title FROM dashboard.favorites ORDER BY id")
|
||||
for r in rows:
|
||||
print(f" [{r['id']}] {r['title']}")
|
||||
|
||||
# Verwijder IDs 11-20
|
||||
deleted = execute("DELETE FROM dashboard.favorites WHERE id >= 11 AND id <= 20")
|
||||
print(f"\n{deleted} rows verwijderd.")
|
||||
|
||||
# Reset sequence
|
||||
execute("SELECT setval('dashboard.favorites_id_seq', (SELECT max(id) FROM dashboard.favorites))")
|
||||
|
||||
print("\nNa opschonen:")
|
||||
rows = query("SELECT id, title FROM dashboard.favorites ORDER BY id")
|
||||
for r in rows:
|
||||
print(f" [{r['id']}] {r['title']}")
|
||||
|
||||
print("\nDone.")
|
||||
Reference in New Issue
Block a user