GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#5)
by Bastien
01:09
created

setup_schema()   A

Complexity

Conditions 1

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 20
rs 9.4285
1
# -*- coding: utf-8 -*-
2
"""Setup the pyjobsweb application"""
3
from __future__ import print_function
4
5
from tg import config
6
import transaction
7
8
9
def setup_schema(command, conf, vars):
10
    """Place any commands to setup pyjobsweb here"""
11
    # Load the models
12
13
    # <websetup.websetup.schema.before.model.import>
14
    from pyjobsweb import model
15
    # <websetup.websetup.schema.after.model.import>
16
17
    # <websetup.websetup.schema.before.metadata.create_all>
18
    print("Creating tables")
19
    model.metadata.create_all(bind=config['tg.app_globals'].sa_engine)
20
    # <websetup.websetup.schema.after.metadata.create_all>
21
    transaction.commit()
22
    print('Initializing Migrations')
23
    import alembic.config
24
    alembic_cfg = alembic.config.Config()
25
    alembic_cfg.set_main_option("script_location", "migration")
26
    alembic_cfg.set_main_option("sqlalchemy.url", config['sqlalchemy.url'])
27
    import alembic.command
28
    alembic.command.stamp(alembic_cfg, "head")
29