This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2018-08-08 19:25:53 +00:00
|
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
|
2018-07-14 14:41:22 +00:00
|
|
|
from teal.db import SQLAlchemy as _SQLAlchemy
|
|
|
|
|
|
|
|
|
|
|
|
class SQLAlchemy(_SQLAlchemy):
|
2018-08-08 19:25:53 +00:00
|
|
|
"""
|
|
|
|
Superuser must create the required extensions in the public
|
|
|
|
schema of the database, as it is in the `search_path`
|
|
|
|
defined in teal.
|
|
|
|
"""
|
|
|
|
UUID = postgresql.UUID
|
|
|
|
|
2018-07-14 14:41:22 +00:00
|
|
|
def drop_all(self, bind='__all__', app=None):
|
|
|
|
"""A faster nuke-like option to drop everything."""
|
|
|
|
self.drop_schema()
|
|
|
|
self.drop_schema(schema='common')
|
|
|
|
|
2018-04-10 15:06:39 +00:00
|
|
|
|
2018-05-30 10:49:40 +00:00
|
|
|
db = SQLAlchemy(session_options={"autoflush": False})
|