diff options
author | Frédéric Mangano-Tarumi <fmang@mg0.fr> | 2020-06-08 20:16:27 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2021-02-20 17:24:30 +0100 |
commit | a5554c19a9712ede5fe5a996bd1bec11cfc9f66a (patch) | |
tree | a9ed3b9b9c0c8db6733278fddf1c0e5ec6be8f39 /migrations | |
parent | 3f31d149a6dd736007c6583a6162aeda1bcc37b8 (diff) | |
download | aur-a5554c19a9712ede5fe5a996bd1bec11cfc9f66a.tar.gz aur-a5554c19a9712ede5fe5a996bd1bec11cfc9f66a.tar.xz |
Add SSO account ID in table Users
This column holds a user ID issed by the single sign-on provider. For
Keycloak, it is an UUID. For more flexibility, we will be using a
standardly-sized VARCHAR field.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'migrations')
-rw-r--r-- | migrations/versions/ef39fcd6e1cd_add_sso_account_id_in_table_users.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/migrations/versions/ef39fcd6e1cd_add_sso_account_id_in_table_users.py b/migrations/versions/ef39fcd6e1cd_add_sso_account_id_in_table_users.py new file mode 100644 index 00000000..9e125165 --- /dev/null +++ b/migrations/versions/ef39fcd6e1cd_add_sso_account_id_in_table_users.py @@ -0,0 +1,30 @@ +"""Add SSO account ID in table Users + +Revision ID: ef39fcd6e1cd +Revises: f47cad5d6d03 +Create Date: 2020-06-08 10:04:13.898617 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'ef39fcd6e1cd' +down_revision = 'f47cad5d6d03' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('Users', sa.Column('SSOAccountID', sa.String(length=255), nullable=True)) + op.create_unique_constraint(None, 'Users', ['SSOAccountID']) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint(None, 'Users', type_='unique') + op.drop_column('Users', 'SSOAccountID') + # ### end Alembic commands ### |