Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Kontr 2.0
Portal API Backend
Commits
958edb61
Verified
Commit
958edb61
authored
May 12, 2019
by
Peter Stanko
Browse files
Adds migration for the project config
parent
bf295171
Pipeline
#32268
passed with stage
in 7 minutes and 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
migrations/versions/95c279617916_.py
0 → 100644
View file @
958edb61
"""empty message
Revision ID: 95c279617916
Revises: 61787ca3cab6
Create Date: 2019-05-12 22:24:31.092439
"""
from
alembic
import
op
import
sqlalchemy
as
sa
# revision identifiers, used by Alembic.
revision
=
'95c279617916'
down_revision
=
'61787ca3cab6'
branch_labels
=
None
depends_on
=
None
def
upgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
drop_constraint
(
'client_codename_key'
,
'client'
,
type_
=
'unique'
)
op
.
add_column
(
'projectConfig'
,
sa
.
Column
(
'config_file'
,
sa
.
String
(
length
=
50
),
nullable
=
True
))
op
.
add_column
(
'projectConfig'
,
sa
.
Column
(
'config_subdir'
,
sa
.
String
(
length
=
50
),
nullable
=
True
))
op
.
drop_column
(
'projectConfig'
,
'submission_scheduler_config'
)
op
.
drop_column
(
'projectConfig'
,
'post_submit_script'
)
op
.
drop_column
(
'projectConfig'
,
'pre_submit_script'
)
# ### end Alembic commands ###
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
add_column
(
'projectConfig'
,
sa
.
Column
(
'pre_submit_script'
,
sa
.
TEXT
(),
autoincrement
=
False
,
nullable
=
True
))
op
.
add_column
(
'projectConfig'
,
sa
.
Column
(
'post_submit_script'
,
sa
.
TEXT
(),
autoincrement
=
False
,
nullable
=
True
))
op
.
add_column
(
'projectConfig'
,
sa
.
Column
(
'submission_scheduler_config'
,
sa
.
TEXT
(),
autoincrement
=
False
,
nullable
=
True
))
op
.
drop_column
(
'projectConfig'
,
'config_subdir'
)
op
.
drop_column
(
'projectConfig'
,
'config_file'
)
op
.
create_unique_constraint
(
'client_codename_key'
,
'client'
,
[
'codename'
])
# ### end Alembic commands ###
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment