"""user_invited_by_link

Revision: 0237
Revision ID: f026609b2ae2
Revises: 5f92d1bc0cfa
Create Date: 2022-03-04 11:31:29.867251

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql


# revision identifiers, used by Alembic.
revision = 'f026609b2ae2'
down_revision = '5f92d1bc0cfa'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('users', sa.Column('invited_by_link', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'users', 'organizations', ['invited_by_link'], ['id'], ondelete='SET NULL')


def downgrade():
    op.drop_column('users', 'invited_by_link')
