Changeset - 325f85a4b3de
[Not reviewed]
0 1 0
Lance Edgar - 5 years ago 2019-10-04 23:08:39
lance@edbob.org
Add `postgresql.create_schema()`
1 file changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general) First comment
rattail_fabric2/postgresql.py
Show inline comments
 
@@ -115,6 +115,14 @@ def create_db(c, name, owner=None, port=None, checkfirst=True):
 
        c.sudo(cmd, user='postgres')
 

	
 

	
 
def create_schema(c, name, dbname, owner='rattail', port=None):
 
    """
 
    Create a schema within a PostgreSQL database.
 
    """
 
    sql_ = "create schema if not exists {} authorization {}".format(name, owner)
 
    sql(c, sql_, database=dbname, port=port)
 

	
 

	
 
def drop_db(c, name, checkfirst=True):
 
    """
 
    Drop a PostgreSQL database.
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now