-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
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,45 @@ | ||
"""document comments | ||
Revision ID: cb2ea87be0bd | ||
Revises: 2a02384ab925 | ||
Create Date: 2024-12-15 01:24:30.954923 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'cb2ea87be0bd' | ||
down_revision: Union[str, None] = '2a02384ab925' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('document_comments', | ||
sa.Column('id', sa.UUID(), nullable=False), | ||
sa.Column('doc_id', sa.UUID(), nullable=True), | ||
sa.Column('author_id', sa.String(), nullable=False), | ||
sa.Column('comment', sa.Text(), nullable=False), | ||
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('NOW()'), nullable=False), | ||
sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('NOW()'), nullable=False), | ||
sa.ForeignKeyConstraint(['author_id'], ['users.id'], ), | ||
sa.ForeignKeyConstraint(['doc_id'], ['document_metadata.id'], ondelete='CASCADE'), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
op.create_index(op.f('ix_document_comments_id'), 'document_comments', ['id'], unique=False) | ||
op.drop_index('ix_notify_id', table_name='notify') | ||
op.create_unique_constraint(None, 'share_url', ['url_id']) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint(None, 'share_url', type_='unique') | ||
op.drop_index(op.f('ix_document_comments_id'), table_name='document_comments') | ||
op.drop_table('document_comments') | ||
# ### end Alembic commands ### |