Compare commits

...

3 Commits

2 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,5 @@
# MOVED PERMANENTLY TO GITHUB
https://github.com/michigg/codimd_note_overview
# CodiMD note overview

View File

@ -0,0 +1,19 @@
import os
import psycopg2
DB_HOST = os.environ.get('DB_HOST')
DB_NAME = os.environ.get('POSTGRES_DB')
DB_USER = os.environ.get('POSTGRES_USER')
DB_PASSWORD = os.environ.get('POSTGRES_PASSWORD')
deletion_statement = 'DELETE FROM "Notes" WHERE "content" = \'\';'
try:
conn = psycopg2.connect(host=DB_HOST, database=DB_NAME, user=DB_USER, password=DB_PASSWORD)
cur = conn.cursor()
cur.execute(deletion_statement)
conn.commit()
cur.close()
conn.close()
except Exception as e:
print(e)