Skip to content

Commit

Permalink
new db prefix support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Apr 10, 2015
1 parent 2900f53 commit 05f1bd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions data/src/entity_mysql/system.py
Expand Up @@ -142,11 +142,11 @@ def apply_types(self, types_map):
types_map["metadata"] = "longtext"

def connect(self, connection, parameters = {}):
default = self.entity_manager.id or "default"
host = parameters.get("host", "localhost")
user = parameters.get("user", "root")
password = parameters.get("password", "root")
database = parameters.get("database", default)
db_prefix = parameters.get("db_prefix", "")
database = parameters.get("database", db_prefix + "default")
isolation = parameters.get("isolation", ISOLATION_LEVEL)
host = colony.conf("DB_HOST", host)
user = colony.conf("DB_USER", user)
Expand Down
4 changes: 2 additions & 2 deletions data/src/entity_pgsql/system.py
Expand Up @@ -129,11 +129,11 @@ def get_database_encoding(self):
return encoding

def connect(self, connection, parameters = {}):
default = self.entity_manager.id or "default"
host = parameters.get("host", "localhost")
user = parameters.get("user", "postgres")
password = parameters.get("password", "postgres")
database = parameters.get("database", default)
db_prefix = parameters.get("db_prefix", "")
database = parameters.get("database", db_prefix + "default")
isolation = parameters.get("isolation", ISOLATION_LEVEL)
host = colony.conf("DB_HOST", host)
user = colony.conf("DB_USER", user)
Expand Down

0 comments on commit 05f1bd6

Please sign in to comment.