fix: create database 'leadsdb' before running migrations
This commit is contained in:
parent
1ad1211b9f
commit
c70aa6c499
23
create_db.py
Normal file
23
create_db.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import psycopg2
|
||||
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
|
||||
|
||||
# Connect to the default database
|
||||
conn = psycopg2.connect(
|
||||
dbname='postgres',
|
||||
user='melkor',
|
||||
password='Th3leetnis!leadsdb',
|
||||
host='barad-dur.lan.mgk.one',
|
||||
port='5433'
|
||||
)
|
||||
|
||||
conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
|
||||
|
||||
cur = conn.cursor()
|
||||
|
||||
# Create the database
|
||||
cur.execute('CREATE DATABASE leadsdb')
|
||||
|
||||
cur.close()
|
||||
conn.close()
|
||||
|
||||
print("Database 'leadsdb' created successfully.")
|
||||
Loading…
Reference in a new issue