Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
19950744
Commit
19950744
authored
3 years ago
by
Cain, Payton David
Browse files
Options
Downloads
Patches
Plain Diff
add alembic revision for dropped metadata_valid column
parent
ae7e3733
No related branches found
No related tags found
2 merge requests
!146
Release CMO metadata to production
,
!113
Remove metadata_valid column
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
migrations/versions/4324b87e0b3c_drop_metadata_valid_column.py
+36
-0
36 additions, 0 deletions
...tions/versions/4324b87e0b3c_drop_metadata_valid_column.py
with
36 additions
and
0 deletions
migrations/versions/4324b87e0b3c_drop_metadata_valid_column.py
0 → 100644
+
36
−
0
View file @
19950744
"""
drop metadata_valid column
Revision ID: 4324b87e0b3c
Revises: 2280fe551e60
Create Date: 2021-07-14 15:48:32.154022
"""
from
alembic
import
op
import
sqlalchemy
as
sa
from
sqlalchemy.dialects
import
mysql
# revision identifiers, used by Alembic.
revision
=
'
4324b87e0b3c
'
down_revision
=
'
2280fe551e60
'
branch_labels
=
None
depends_on
=
None
def
upgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
drop_index
(
'
ix_metadata_metadata_valid
'
,
table_name
=
'
metadata
'
)
op
.
drop_index
(
'
index_station_metadata
'
,
table_name
=
'
metadata
'
)
op
.
create_index
(
'
index_station_metadata
'
,
'
metadata
'
,
[
'
network
'
,
'
station
'
,
'
channel
'
,
'
location
'
,
'
category
'
,
'
starttime
'
,
'
endtime
'
,
'
data_valid
'
,
'
status
'
],
unique
=
False
)
op
.
drop_column
(
'
metadata
'
,
'
metadata_valid
'
)
op
.
drop_column
(
'
metadata_history
'
,
'
metadata_valid
'
)
# ### end Alembic commands ###
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
add_column
(
'
metadata_history
'
,
sa
.
Column
(
'
metadata_valid
'
,
mysql
.
TINYINT
(
display_width
=
1
),
autoincrement
=
False
,
nullable
=
True
))
op
.
add_column
(
'
metadata
'
,
sa
.
Column
(
'
metadata_valid
'
,
mysql
.
TINYINT
(
display_width
=
1
),
autoincrement
=
False
,
nullable
=
True
))
op
.
drop_index
(
'
index_station_metadata
'
,
table_name
=
'
metadata
'
)
op
.
create_index
(
'
index_station_metadata
'
,
'
metadata
'
,
[
'
network
'
,
'
station
'
,
'
channel
'
,
'
location
'
,
'
category
'
,
'
starttime
'
,
'
endtime
'
,
'
metadata_valid
'
,
'
data_valid
'
,
'
status
'
],
unique
=
False
)
op
.
create_index
(
'
ix_metadata_metadata_valid
'
,
'
metadata
'
,
[
'
metadata_valid
'
],
unique
=
False
)
# ### 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