Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
X
xivo-dao
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xivo.solutions
xivo-dao
Commits
44249b92
Commit
44249b92
authored
Jun 24, 2020
by
Etienne Allovon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3386 - add primary key and standardize the column name
parent
c083ab21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
xivo_dao/alchemy/userlabels.py
xivo_dao/alchemy/userlabels.py
+5
-10
No files found.
xivo_dao/alchemy/userlabels.py
View file @
44249b92
...
...
@@ -19,9 +19,6 @@ from sqlalchemy.schema import Column, ForeignKeyConstraint, PrimaryKeyConstraint
from
sqlalchemy.types
import
Integer
,
String
from
sqlalchemy.orm
import
relationship
from
xivo_dao.alchemy.labels
import
Labels
from
xivo_dao.alchemy.userfeatures
import
UserFeatures
from
xivo_dao.helpers.db_manager
import
Base
...
...
@@ -29,16 +26,14 @@ class UserLabels(Base):
__tablename__
=
'userlabels'
__table_args__
=
(
ForeignKeyConstraint
((
'userid'
,),
PrimaryKeyConstraint
(
'user_id'
,
'label_id'
),
ForeignKeyConstraint
((
'user_id'
,),
(
'userfeatures.id'
,),
ondelete
=
'RESTRICT'
),
ForeignKeyConstraint
((
'labelid'
,),
ForeignKeyConstraint
((
'label
_
id'
,),
(
'labels.id'
,),
ondelete
=
'RESTRICT'
),
)
userid
=
Column
(
Integer
,
nullable
=
False
)
labelid
=
Column
(
Integer
,
nullable
=
False
)
label
=
relationship
(
Labels
)
user_id
=
Column
(
Integer
,
nullable
=
False
)
label_id
=
Column
(
Integer
,
nullable
=
False
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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