Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
65d397d3
Commit
65d397d3
authored
1 year ago
by
Mohammad Torkashvand
Browse files
Options
Downloads
Patches
Plain Diff
alter email in partner table and make it required
parent
19cdf9f9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!179
alter email in partner table and make it required
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/db/models.py
+6
-5
6 additions, 5 deletions
gso/db/models.py
gso/migrations/versions/2024-03-20_d61c0f92da1e_edit_partner_table_making_some_fields_.py
+30
-0
30 additions, 0 deletions
...20_d61c0f92da1e_edit_partner_table_making_some_fields_.py
with
36 additions
and
5 deletions
gso/db/models.py
+
6
−
5
View file @
65d397d3
...
...
@@ -33,18 +33,19 @@ class PartnerTable(BaseModel):
__tablename__
=
"
partners
"
partner_id
=
mapped_column
(
String
,
server_default
=
text
(
"
uuid_generate_v4
"
),
primary_key
=
True
)
name
=
mapped_column
(
String
,
unique
=
True
)
email
=
mapped_column
(
String
,
unique
=
True
,
nullable
=
True
)
name
=
mapped_column
(
String
,
unique
=
True
,
nullable
=
True
)
email
=
mapped_column
(
String
,
unique
=
True
,
nullable
=
False
)
partner_type
=
mapped_column
(
Enum
(
PartnerType
),
nullable
=
False
)
as_number
=
mapped_column
(
String
,
unique
=
True
String
,
unique
=
True
,
nullable
=
True
)
# the as_number and as_set are mutually exclusive. if you give me one I don't need the other
as_set
=
mapped_column
(
String
)
as_set
=
mapped_column
(
String
,
nullable
=
True
)
route_set
=
mapped_column
(
String
,
nullable
=
True
)
black_listed_as_sets
=
mapped_column
(
ARRAY
(
String
),
nullable
=
True
)
additional_routers
=
mapped_column
(
ARRAY
(
String
),
nullable
=
True
)
additional_bgp_speakers
=
mapped_column
(
ARRAY
(
String
),
nullable
=
True
)
partner_type
=
mapped_column
(
Enum
(
PartnerType
),
nullable
=
False
)
created_at
=
mapped_column
(
UtcTimestamp
,
server_default
=
text
(
"
current_timestamp
"
),
nullable
=
False
)
updated_at
=
mapped_column
(
UtcTimestamp
,
server_default
=
text
(
"
current_timestamp
"
),
nullable
=
False
,
onupdate
=
text
(
"
current_timestamp
"
)
...
...
This diff is collapsed.
Click to expand it.
gso/migrations/versions/2024-03-20_d61c0f92da1e_edit_partner_table_making_some_fields_.py
0 → 100644
+
30
−
0
View file @
65d397d3
"""
Edit Partner table, Making some fields required.
Revision ID: d61c0f92da1e
Revises: eaed66b04913
Create Date: 2024-03-20 12:29:24.145489
"""
import
sqlalchemy
as
sa
from
alembic
import
op
# revision identifiers, used by Alembic.
revision
=
'
d61c0f92da1e
'
down_revision
=
'
eaed66b04913
'
branch_labels
=
None
depends_on
=
None
def
upgrade
()
->
None
:
conn
=
op
.
get_bind
()
conn
.
execute
(
sa
.
text
(
"""
UPDATE partners SET email =
'
goat@geant.org
'
WHERE name=
'
GEANT
'"""
))
op
.
alter_column
(
'
partners
'
,
'
email
'
,
existing_type
=
sa
.
String
(),
nullable
=
False
)
def
downgrade
()
->
None
:
# ### commands auto generated by Alembic - please adjust! ###
op
.
alter_column
(
'
partners
'
,
'
email
'
,
existing_type
=
sa
.
String
(),
nullable
=
True
)
# ### 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