-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Edit refactor models, routes and utils to use UUID instead of id i…
…ntegers (#153) Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com> Co-authored-by: User <alejsdev@gmail.com> Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
- Loading branch information
1 parent
2db5d29
commit 7e24bb9
Showing
28 changed files
with
852 additions
and
1,216 deletions.
There are no files selected for viewing
39 changes: 0 additions & 39 deletions
39
backend/app/alembic/versions/2e7525f9d21b_add_username_and_is_verified_column_.py
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
backend/app/alembic/versions/30a55259019b_add_column_personal_team_id_to_user_.py
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
backend/app/alembic/versions/3a7df55f39d3_add_invitations_table.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
backend/app/alembic/versions/56310da83983_add_organization_table_and_.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
77 changes: 77 additions & 0 deletions
77
backend/app/alembic/versions/89c9a00d523e_initial_setup.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
"""Initial setup | ||
Revision ID: 89c9a00d523e | ||
Revises: | ||
Create Date: 2024-07-18 22:25:02.356343 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
import sqlmodel.sql.sqltypes | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '89c9a00d523e' | ||
down_revision = None | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('team', | ||
sa.Column('name', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False), | ||
sa.Column('description', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=True), | ||
sa.Column('id', sa.Uuid(), nullable=False), | ||
sa.Column('slug', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
op.create_index(op.f('ix_team_slug'), 'team', ['slug'], unique=True) | ||
op.create_table('user', | ||
sa.Column('email', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False), | ||
sa.Column('is_active', sa.Boolean(), nullable=False), | ||
sa.Column('full_name', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False), | ||
sa.Column('id', sa.Uuid(), nullable=False), | ||
sa.Column('hashed_password', sqlmodel.sql.sqltypes.AutoString(), nullable=False), | ||
sa.Column('username', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False), | ||
sa.Column('is_verified', sa.Boolean(), nullable=False), | ||
sa.Column('personal_team_id', sa.Uuid(), nullable=True), | ||
sa.ForeignKeyConstraint(['personal_team_id'], ['team.id'], ), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True) | ||
op.create_index(op.f('ix_user_username'), 'user', ['username'], unique=True) | ||
op.create_table('invitation', | ||
sa.Column('role', sa.Enum('member', 'admin', name='role'), nullable=False), | ||
sa.Column('email', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False), | ||
sa.Column('id', sa.Uuid(), nullable=False), | ||
sa.Column('team_id', sa.Uuid(), nullable=False), | ||
sa.Column('invited_by_id', sa.Uuid(), nullable=False), | ||
sa.Column('status', sa.Enum('pending', 'accepted', name='invitationstatus'), nullable=False), | ||
sa.Column('created_at', sa.DateTime(), nullable=False), | ||
sa.Column('expires_at', sa.DateTime(), nullable=False), | ||
sa.ForeignKeyConstraint(['invited_by_id'], ['user.id'], ), | ||
sa.ForeignKeyConstraint(['team_id'], ['team.id'], ), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
op.create_table('userteamlink', | ||
sa.Column('user_id', sa.Uuid(), nullable=False), | ||
sa.Column('team_id', sa.Uuid(), nullable=False), | ||
sa.Column('role', sa.Enum('member', 'admin', name='role'), nullable=False), | ||
sa.ForeignKeyConstraint(['team_id'], ['team.id'], ), | ||
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), | ||
sa.PrimaryKeyConstraint('user_id', 'team_id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('userteamlink') | ||
op.drop_table('invitation') | ||
op.drop_index(op.f('ix_user_username'), table_name='user') | ||
op.drop_index(op.f('ix_user_email'), table_name='user') | ||
op.drop_table('user') | ||
op.drop_index(op.f('ix_team_slug'), table_name='team') | ||
op.drop_table('team') | ||
# ### end Alembic commands ### |
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
backend/app/alembic/versions/a9b76125b71a_remove_is_superuser_from_user_table_and_.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.