forked from mozilla-services/socorro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1f9054518c57_bug_890650_fix_rapid.py
63 lines (45 loc) · 1.36 KB
/
1f9054518c57_bug_890650_fix_rapid.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"""bug 890650 fix rapid beta in crashes by user build
Revision ID: 1f9054518c57
Revises: 2c03d8ea0a50
Create Date: 2013-08-28 12:22:03.217984
"""
# revision identifiers, used by Alembic.
revision = '1f9054518c57'
down_revision = '2c03d8ea0a50'
import os
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy import types
from sqlalchemy.sql import table, column
class CITEXT(types.UserDefinedType):
name = 'citext'
def get_col_spec(self):
return 'CITEXT'
def bind_processor(self, dialect):
return lambda value: value
def result_processor(self, dialect, coltype):
return lambda value: value
def __repr__(self):
return "citext"
class JSON(types.UserDefinedType):
name = 'json'
def get_col_spec(self):
return 'JSON'
def bind_processor(self, dialect):
return lambda value: value
def result_processor(self, dialect, coltype):
return lambda value: value
def __repr__(self):
return "json"
def upgrade():
app_path=os.getcwd()
procs = [
'update_build_adu.sql'
, 'update_crashes_by_user_build.sql'
]
for myfile in [app_path + '/socorro/external/postgresql/raw_sql/procs/' + line for line in procs]:
with open(myfile, 'r') as file:
op.execute(file.read())
def downgrade():
pass