forked from polka_billy/porridger
Ratings table added
This commit is contained in:
@ -0,0 +1,37 @@
|
||||
"""Many to many relationship Rating added
|
||||
|
||||
Revision ID: a309e6ee6307
|
||||
Revises: cf0525fd49a8
|
||||
Create Date: 2024-08-28 22:08:08.399530
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'a309e6ee6307'
|
||||
down_revision: Union[str, None] = 'cf0525fd49a8'
|
||||
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('ratings',
|
||||
sa.Column('rated_user_id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_giving_rating_id', sa.Integer(), nullable=False),
|
||||
sa.Column('rating_value', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['rated_user_id'], ['users.id'], ),
|
||||
sa.ForeignKeyConstraint(['user_giving_rating_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('rated_user_id', 'user_giving_rating_id', 'rating_value')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('ratings')
|
||||
# ### end Alembic commands ###
|
@ -0,0 +1,30 @@
|
||||
"""booked_by column removed in Announcements table
|
||||
|
||||
Revision ID: cf0525fd49a8
|
||||
Revises: 19dbd9793f11
|
||||
Create Date: 2024-08-28 21:59:23.787732
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'cf0525fd49a8'
|
||||
down_revision: Union[str, None] = '19dbd9793f11'
|
||||
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.drop_column('announcements', 'booked_by')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('announcements', sa.Column('booked_by', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
# ### end Alembic commands ###
|
Reference in New Issue
Block a user