squash invitation migrations
This commit is contained in:
parent
151d5be5ea
commit
ead84834d0
@ -1,30 +0,0 @@
|
||||
"""add status to invitation
|
||||
|
||||
Revision ID: 03654d08f5ff
|
||||
Revises: 2bec1868a22a
|
||||
Create Date: 2018-10-26 12:59:16.709080
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '03654d08f5ff'
|
||||
down_revision = '2bec1868a22a'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('invitations', sa.Column('status', sa.Enum('ACCEPTED', 'REVOKED', 'PENDING', 'REJECTED', name='status', native_enum=False), nullable=True))
|
||||
op.drop_column('invitations', 'valid')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('invitations', sa.Column('valid', sa.BOOLEAN(), autoincrement=False, nullable=True))
|
||||
op.drop_column('invitations', 'status')
|
||||
# ### end Alembic commands ###
|
@ -24,13 +24,19 @@ def upgrade():
|
||||
sa.Column('id', postgresql.UUID(as_uuid=True), server_default=sa.text('uuid_generate_v4()'), nullable=False),
|
||||
sa.Column('user_id', postgresql.UUID(as_uuid=True), nullable=True),
|
||||
sa.Column('workspace_id', postgresql.UUID(as_uuid=True), nullable=True),
|
||||
sa.Column('valid', sa.Boolean(), nullable=True),
|
||||
sa.Column('status', sa.Enum('ACCEPTED', 'REVOKED', 'PENDING', 'REJECTED', name='status', native_enum=False), nullable=True),
|
||||
sa.Column('inviter_id', postgresql.UUID(as_uuid=True), nullable=True),
|
||||
sa.Column('token', sa.String(), nullable=True),
|
||||
sa.Column('expiration_time', sa.TIMESTAMP(timezone=True), nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.ForeignKeyConstraint(['inviter_id'], ['users.id'], ),
|
||||
sa.ForeignKeyConstraint(['workspace_id'], ['workspaces.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_invitations_user_id'), 'invitations', ['user_id'], unique=False)
|
||||
op.create_index(op.f('ix_invitations_inviter_id'), 'invitations', ['inviter_id'], unique=False)
|
||||
op.create_index(op.f('ix_invitations_workspace_id'), 'invitations', ['workspace_id'], unique=False)
|
||||
op.create_index(op.f('ix_invitations_token'), 'invitations', ['token'], unique=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
|
@ -1,32 +0,0 @@
|
||||
"""add inviter relationship to invitation
|
||||
|
||||
Revision ID: 2bec1868a22a
|
||||
Revises: c7feaa7b6b0c
|
||||
Create Date: 2018-10-26 12:45:13.192062
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2bec1868a22a'
|
||||
down_revision = 'c7feaa7b6b0c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('invitations', sa.Column('inviter_id', postgresql.UUID(as_uuid=True), nullable=True))
|
||||
op.create_index(op.f('ix_invitations_inviter_id'), 'invitations', ['inviter_id'], unique=False)
|
||||
op.create_foreign_key(None, 'invitations', 'users', ['inviter_id'], ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'invitations', type_='foreignkey')
|
||||
op.drop_index(op.f('ix_invitations_inviter_id'), table_name='invitations')
|
||||
op.drop_column('invitations', 'inviter_id')
|
||||
# ### end Alembic commands ###
|
@ -1,28 +0,0 @@
|
||||
"""remove accepted from workspace_role
|
||||
|
||||
Revision ID: 67955a4abaef
|
||||
Revises: e62bcc460c26
|
||||
Create Date: 2018-10-26 13:57:29.480236
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '67955a4abaef'
|
||||
down_revision = 'e62bcc460c26'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('workspace_roles', 'accepted')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('workspace_roles', sa.Column('accepted', sa.BOOLEAN(), autoincrement=False, nullable=True))
|
||||
# ### end Alembic commands ###
|
@ -1,30 +0,0 @@
|
||||
"""add token to invitation
|
||||
|
||||
Revision ID: 81e6babf5136
|
||||
Revises: 67955a4abaef
|
||||
Create Date: 2018-10-29 09:26:30.728348
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '81e6babf5136'
|
||||
down_revision = '67955a4abaef'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('invitations', sa.Column('token', sa.String(), nullable=True))
|
||||
op.create_index(op.f('ix_invitations_token'), 'invitations', ['token'], unique=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_invitations_token'), table_name='invitations')
|
||||
op.drop_column('invitations', 'token')
|
||||
# ### end Alembic commands ###
|
@ -1,28 +0,0 @@
|
||||
"""add accepted column to workspace role
|
||||
|
||||
Revision ID: c7feaa7b6b0c
|
||||
Revises: 5284ac1ac77c
|
||||
Create Date: 2018-10-25 11:44:17.654892
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'c7feaa7b6b0c'
|
||||
down_revision = '5284ac1ac77c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('workspace_roles', sa.Column('accepted', sa.Boolean(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('workspace_roles', 'accepted')
|
||||
# ### end Alembic commands ###
|
@ -1,28 +0,0 @@
|
||||
"""add expiration_time to invitation
|
||||
|
||||
Revision ID: e62bcc460c26
|
||||
Revises: 03654d08f5ff
|
||||
Create Date: 2018-10-26 13:37:39.015003
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'e62bcc460c26'
|
||||
down_revision = '03654d08f5ff'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('invitations', sa.Column('expiration_time', sa.TIMESTAMP(timezone=True), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('invitations', 'expiration_time')
|
||||
# ### end Alembic commands ###
|
Loading…
x
Reference in New Issue
Block a user