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
Push — master ( cc823b...3d112a )
by PyJobs
9s
created

run_migrations_online()   B

Complexity

Conditions 2

Size

Total Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 25
rs 8.8571
1
from __future__ import with_statement
2
from alembic import context
3
from sqlalchemy import engine_from_config, pool
4
5
# this is the Alembic Config object, which provides
6
# access to the values within the .ini file in use.
7
config = context.config
8
9
# Interpret the config file for Python logging.
10
# This line sets up loggers basically.
11
# from logging.config import fileConfig
12
# fileConfig(config.config_file_name)
13
14
# add your model's MetaData object here
15
# for 'autogenerate' support
16
# from myapp import mymodel
17
# target_metadata = mymodel.Base.metadata
18
from pyjobsweb import model
19
target_metadata = model.metadata
20
21
# other values from the config, defined by the needs of env.py,
22
# can be acquired:
23
# my_important_option = config.get_main_option("my_important_option")
24
# ... etc.
25
26
27
def run_migrations_offline():
28
    """Run migrations in 'offline' mode.
29
30
    This configures the context with just a URL
31
    and not an Engine, though an Engine is acceptable
32
    here as well.  By skipping the Engine creation
33
    we don't even need a DBAPI to be available.
34
35
    Calls to context.execute() here emit the given string to the
36
    script output.
37
38
    """
39
    url = config.get_main_option("sqlalchemy.url")
40
    context.configure(url=url, version_table='migrate_version')
41
42
    with context.begin_transaction():
43
        context.run_migrations()
44
45
46
def run_migrations_online():
47
    """Run migrations in 'online' mode.
48
49
    In this scenario we need to create an Engine
50
    and associate a connection with the context.
51
52
    """
53
    engine = engine_from_config(
54
        config.get_section(config.config_ini_section),
55
        prefix='sqlalchemy.',
56
        poolclass=pool.NullPool
57
    )
58
59
    connection = engine.connect()
60
    context.configure(
61
        connection=connection,
62
        target_metadata=target_metadata,
63
        version_table='migrate_version'
64
    )
65
66
    try:
67
        with context.begin_transaction():
68
            context.run_migrations()
69
    finally:
70
        connection.close()
71
72
73
if context.is_offline_mode():
74
    run_migrations_offline()
75
else:
76
    run_migrations_online()
77