"""auto

Revision ID: 72455429fdaf
Revises: 501b54868875
Create Date: 2025-06-05 05:07:43.605568

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

# revision identifiers, used by Alembic.
revision = '72455429fdaf'
down_revision = '501b54868875'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('transfer_request',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('plant_id', sa.Integer(), nullable=False),
    sa.Column('seller_id', sa.Integer(), nullable=False),
    sa.Column('buyer_id', sa.Integer(), nullable=False),
    sa.Column('status', sa.String(length=20), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('seller_message', sa.String(length=512), nullable=True),
    sa.Column('buyer_message', sa.String(length=512), nullable=True),
    sa.ForeignKeyConstraint(['buyer_id'], ['users.id'], ),
    sa.ForeignKeyConstraint(['plant_id'], ['plant.id'], ),
    sa.ForeignKeyConstraint(['seller_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('plant', sa.Column('data_verified', sa.Boolean(), nullable=False))
    op.drop_column('plant_ownership_log', 'graph_node_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('plant_ownership_log', sa.Column('graph_node_id', mysql.VARCHAR(length=255), nullable=True))
    op.drop_column('plant', 'data_verified')
    op.drop_table('transfer_request')
    # ### end Alembic commands ###
