<s> import logging <EOL> from flask . ext import migrate <EOL> from aleph . core import db <EOL> from aleph . model . role import Role <EOL> from aleph . model . alert import Alert <EOL> from aleph . model . permission import Permission <EOL> from aleph . model . source import Source <EOL> from aleph . model . entity import Entity <EOL> from aleph . model . reference import Reference <EOL> from aleph . model . collection import Collection <EOL> from aleph . model . log import ProcessingLog <EOL> from aleph . model . metadata import Metadata <EOL> from aleph . model . document import Document , DocumentPage , DocumentRecord <EOL> from aleph . model . validation import validate <EOL> log = logging . getLogger ( __name__ ) <EOL> def clear_session ( ) : <EOL> db . session . rollback ( ) <EOL> def upgrade_db ( ) : <EOL> log . info ( "<STR_LIT>" ) <EOL> migrate . upgrade ( ) <EOL> create_system_roles <EOL> def create_system_roles ( ) : <EOL> log . info ( "<STR_LIT>" ) <EOL> Role . load_or_create ( Role . SYSTEM_GUEST , Role . SYSTEM , '<STR_LIT>' ) <EOL> Role . load_or_create ( Role . SYSTEM_USER , Role . SYSTEM , '<STR_LIT>' ) <EOL> db . session . commit ( ) </s>
