Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unique constraint on email_role #56

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
CHANGELOG
*********

1.6.6 (2023-??-??)
------------------

**🚀 Nouveautés**

* Ajout d’une contrainte d’unicité sur la colonne ``email`` de la table ``t_roles``.

1.6.5 (2023-03-04)
------------------

Expand Down Expand Up @@ -52,7 +59,7 @@ CHANGELOG

**🚀 Nouveautés**

* Ajout d’une contrainte d’unicité sur la colonn ``uuid_role`` de la table ``t_roles``.
* Ajout d’une contrainte d’unicité sur la colonne ``uuid_role`` de la table ``t_roles``.
* Ajout des modèles ``UserList`` et ``cor_role_liste`` correspondants aux tables existantes.
* Compatibilité Flask 2

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""add unique constraint on email_role

Revision ID: 36998af706d1
Revises: 112ccf1024ce
Create Date: 2023-03-09 11:18:14.006181

"""
from alembic import op


# revision identifiers, used by Alembic.
revision = '36998af706d1'
down_revision = '112ccf1024ce'
branch_labels = None
depends_on = None


def upgrade():
op.create_unique_constraint(
constraint_name="t_roles_email_un",
table_name="t_roles",
columns=["email"],
schema="utilisateurs"
)


def downgrade():
op.drop_constraint(
constraint_name="t_roles_email_un",
table_name="t_roles",
schema="utilisateurs"
)