Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PyBusMap
Manage
Activity
Members
Labels
Plan
Issues
10
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton Sarukhanov
PyBusMap
Commits
67bccdc8
Commit
67bccdc8
authored
9 years ago
by
Anton Sarukhanov
Browse files
Options
Downloads
Patches
Plain Diff
Models fixes (migration)
parent
10268c46
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
migrations/versions/40964e5a022_.py
+13
-12
13 additions, 12 deletions
migrations/versions/40964e5a022_.py
with
13 additions
and
12 deletions
migrations/versions/
295c9a7939e
_.py
→
migrations/versions/
40964e5a022
_.py
+
13
−
12
View file @
67bccdc8
"""
empty message
Revision ID:
295c9a7939e
Revision ID:
40964e5a022
Revises: None
Create Date: 2016-0
1-21 10:08:57.96458
9
Create Date: 2016-0
2-01 17:29:17.47775
9
"""
# revision identifiers, used by Alembic.
revision
=
'
295c9a7939e
'
revision
=
'
40964e5a022
'
down_revision
=
None
from
alembic
import
op
...
...
@@ -32,9 +32,9 @@ def upgrade():
sa
.
Column
(
'
title
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
api_call_id
'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'
api_call_id
'
],
[
'
api_call.id
'
],
ondelete
=
'
set null
'
),
sa
.
PrimaryKeyConstraint
(
'
id
'
),
sa
.
UniqueConstraint
(
'
title
'
)
sa
.
PrimaryKeyConstraint
(
'
id
'
)
)
op
.
create_index
(
op
.
f
(
'
ix_region_title
'
),
'
region
'
,
[
'
title
'
],
unique
=
True
)
op
.
create_table
(
'
stop
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
stop_id
'
,
sa
.
Integer
(),
nullable
=
True
),
...
...
@@ -52,7 +52,7 @@ def upgrade():
sa
.
Column
(
'
tag
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
title
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
short_title
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
region_id
'
,
sa
.
Integer
(),
nullable
=
Tru
e
),
sa
.
Column
(
'
region_id
'
,
sa
.
Integer
(),
nullable
=
Fals
e
),
sa
.
Column
(
'
api_call_id
'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'
api_call_id
'
],
[
'
api_call.id
'
],
ondelete
=
'
set null
'
),
sa
.
ForeignKeyConstraint
([
'
region_id
'
],
[
'
region.id
'
],
ondelete
=
'
cascade
'
),
...
...
@@ -61,7 +61,7 @@ def upgrade():
)
op
.
create_table
(
'
route
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
agency_id
'
,
sa
.
Integer
(),
nullable
=
Tru
e
),
sa
.
Column
(
'
agency_id
'
,
sa
.
Integer
(),
nullable
=
Fals
e
),
sa
.
Column
(
'
tag
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
title
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
short_title
'
,
sa
.
String
(),
nullable
=
True
),
...
...
@@ -79,7 +79,7 @@ def upgrade():
)
op
.
create_table
(
'
direction
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
route_id
'
,
sa
.
Integer
(),
nullable
=
Tru
e
),
sa
.
Column
(
'
route_id
'
,
sa
.
Integer
(),
nullable
=
Fals
e
),
sa
.
Column
(
'
tag
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
title
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
name
'
,
sa
.
String
(),
nullable
=
True
),
...
...
@@ -92,19 +92,19 @@ def upgrade():
op
.
create_table
(
'
route_stop
'
,
sa
.
Column
(
'
route_id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
stop_id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
stop_tag
'
,
sa
.
String
(),
nullable
=
Tru
e
),
sa
.
Column
(
'
stop_tag
'
,
sa
.
String
(),
nullable
=
Fals
e
),
sa
.
ForeignKeyConstraint
([
'
route_id
'
],
[
'
route.id
'
],
ondelete
=
'
cascade
'
),
sa
.
ForeignKeyConstraint
([
'
stop_id
'
],
[
'
stop.id
'
],
ondelete
=
'
cascade
'
),
sa
.
PrimaryKeyConstraint
(
'
route_id
'
,
'
stop_id
'
)
)
op
.
create_table
(
'
prediction
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
route_id
'
,
sa
.
Integer
(),
nullable
=
Tru
e
),
sa
.
Column
(
'
route_id
'
,
sa
.
Integer
(),
nullable
=
Fals
e
),
sa
.
Column
(
'
prediction
'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'
created
'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'
is_departure
'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'
has_layover
'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'
direction_id
'
,
sa
.
Integer
(),
nullable
=
Tru
e
),
sa
.
Column
(
'
direction_id
'
,
sa
.
Integer
(),
nullable
=
Fals
e
),
sa
.
Column
(
'
vehicle
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
block
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
stop_id
'
,
sa
.
Integer
(),
nullable
=
True
),
...
...
@@ -118,7 +118,7 @@ def upgrade():
op
.
create_table
(
'
vehicle_location
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
vehicle
'
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
'
route_id
'
,
sa
.
Integer
(),
nullable
=
Tru
e
),
sa
.
Column
(
'
route_id
'
,
sa
.
Integer
(),
nullable
=
Fals
e
),
sa
.
Column
(
'
direction_id
'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
Column
(
'
lat
'
,
sa
.
Float
(),
nullable
=
True
),
sa
.
Column
(
'
lon
'
,
sa
.
Float
(),
nullable
=
True
),
...
...
@@ -144,6 +144,7 @@ def downgrade():
op
.
drop_table
(
'
route
'
)
op
.
drop_table
(
'
agency
'
)
op
.
drop_table
(
'
stop
'
)
op
.
drop_index
(
op
.
f
(
'
ix_region_title
'
),
table_name
=
'
region
'
)
op
.
drop_table
(
'
region
'
)
op
.
drop_table
(
'
api_call
'
)
### end Alembic commands ###
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment