Update db-creation.py
continuous-integration/drone/push Build is failing Details

main
Félix MIELCAREK 1 year ago committed by GitHub
parent 4037f65461
commit 2624a179aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,5 +1,6 @@
import psycopg2
import os import os
import psycopg2
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
env_dbname = os.getenv('POSTGRES_DATABASE') env_dbname = os.getenv('POSTGRES_DATABASE')
env_user = os.getenv('POSTGRES_USER') env_user = os.getenv('POSTGRES_USER')
@ -7,12 +8,11 @@ env_password = os.getenv('POSTGRES_PASSWORD')
# Establish connection to the PostgreSQL database # Establish connection to the PostgreSQL database
conn = psycopg2.connect(dbname="postgres", user=env_user, password=env_password, host="felixmielcarek-bigbrotherdb") conn = psycopg2.connect(dbname="postgres", user=env_user, password=env_password, host="felixmielcarek-bigbrotherdb")
con.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
# Create a cursor object to execute SQL queries # Create a cursor object to execute SQL queries
cur = conn.cursor() cur = conn.cursor()
conn.autocommit = True
create_db_query = ''' create_db_query = '''
-- Database: bigbrother -- Database: bigbrother

Loading…
Cancel
Save