sort of working, more changes

This commit is contained in:
2025-06-09 05:45:58 -05:00
parent d442cad0bb
commit f0b1abd622
102 changed files with 1448 additions and 2264 deletions

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 0fcf1e150ae2
Revises: 58516c9892e9
Create Date: 2025-06-05 09:31:44.116783
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0fcf1e150ae2'
down_revision = '58516c9892e9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,8 +1,8 @@
"""auto
Revision ID: 00991befbf1d
Revises: 1cd7fa3f84ce
Create Date: 2025-06-09 02:54:23.747908
Revision ID: 13e8b68e0737
Revises: 3065b811b58f
Create Date: 2025-06-09 08:05:24.660884
"""
from alembic import op
@ -10,8 +10,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '00991befbf1d'
down_revision = '1cd7fa3f84ce'
revision = '13e8b68e0737'
down_revision = '3065b811b58f'
branch_labels = None
depends_on = None

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 1c7cef84b4ae
Revises: 26803929dc3e
Create Date: 2025-06-04 22:07:43.375613
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1c7cef84b4ae'
down_revision = '26803929dc3e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('plant', sa.Column('is_verified', sa.Boolean(), nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('plant', 'is_verified')
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 1cd7fa3f84ce
Revises: e0afd892f86e
Create Date: 2025-06-09 02:46:59.792016
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1cd7fa3f84ce'
down_revision = 'e0afd892f86e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 1edc2e2c93cd
Revises: d11c2e8b173a
Create Date: 2025-06-09 04:36:51.035371
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1edc2e2c93cd'
down_revision = 'd11c2e8b173a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,8 +1,8 @@
"""auto
Revision ID: 0171b270afc1
Revises: 4d9859ada63b
Create Date: 2025-06-04 06:20:47.463202
Revision ID: 1f5b1e0b6b05
Revises: 3426fe15f0ce
Create Date: 2025-06-09 09:41:17.949317
"""
from alembic import op
@ -10,8 +10,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0171b270afc1'
down_revision = '4d9859ada63b'
revision = '1f5b1e0b6b05'
down_revision = '3426fe15f0ce'
branch_labels = None
depends_on = None

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 246f5cce6c15
Revises: 90401e0dbe75
Create Date: 2025-06-09 05:22:52.461981
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '246f5cce6c15'
down_revision = '90401e0dbe75'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 263b128622a9
Revises: 00991befbf1d
Create Date: 2025-06-09 04:06:48.275595
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '263b128622a9'
down_revision = '00991befbf1d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 26803929dc3e
Revises: 07d152ee2ac2
Create Date: 2025-06-04 06:38:27.377036
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '26803929dc3e'
down_revision = '07d152ee2ac2'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 27a65a4e055c
Revises: 48d93714beaf
Create Date: 2025-06-05 04:23:44.796455
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '27a65a4e055c'
down_revision = '48d93714beaf'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 2a0b02a42543
Revises: 93b893e47742
Create Date: 2025-06-05 02:41:56.741133
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2a0b02a42543'
down_revision = '93b893e47742'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 2fa6feb17477
Revises: 9cff183551e1
Create Date: 2025-06-05 00:45:39.693560
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2fa6feb17477'
down_revision = '9cff183551e1'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,8 +1,8 @@
"""auto
Revision ID: 01e2d617ae49
Revises: 460dbe73c1bc
Create Date: 2025-06-09 04:23:50.730127
Revision ID: 3065b811b58f
Revises: fa22b011d450
Create Date: 2025-06-09 07:41:07.546689
"""
from alembic import op
@ -10,8 +10,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '01e2d617ae49'
down_revision = '460dbe73c1bc'
revision = '3065b811b58f'
down_revision = 'fa22b011d450'
branch_labels = None
depends_on = None

View File

@ -1,8 +1,8 @@
"""auto
Revision ID: 07d152ee2ac2
Revises: 0171b270afc1
Create Date: 2025-06-04 06:24:51.986909
Revision ID: 33e98411843d
Revises: c10353a20277
Create Date: 2025-06-09 09:30:42.712274
"""
from alembic import op
@ -10,8 +10,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '07d152ee2ac2'
down_revision = '0171b270afc1'
revision = '33e98411843d'
down_revision = 'c10353a20277'
branch_labels = None
depends_on = None

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: 3426fe15f0ce
Revises: 33e98411843d
Create Date: 2025-06-09 09:34:33.556990
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3426fe15f0ce'
down_revision = '33e98411843d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,70 +0,0 @@
"""auto
Revision ID: 373571dfe134
Revises: 0fcf1e150ae2
Create Date: 2025-06-05 09:38:55.414193
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '373571dfe134'
down_revision = '0fcf1e150ae2'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('submission_images', sa.Column('file_url', sa.String(length=256), nullable=False))
op.add_column('submission_images', sa.Column('uploaded_at', sa.DateTime(), nullable=True))
op.drop_column('submission_images', 'is_visible')
op.drop_column('submission_images', 'file_path')
op.add_column('submissions', sa.Column('submitted_at', sa.DateTime(), nullable=True))
op.add_column('submissions', sa.Column('plant_name', sa.String(length=100), nullable=False))
op.add_column('submissions', sa.Column('approved', sa.Boolean(), nullable=True))
op.add_column('submissions', sa.Column('approved_at', sa.DateTime(), nullable=True))
op.add_column('submissions', sa.Column('reviewed_by', sa.Integer(), nullable=True))
op.drop_constraint(op.f('submissions_ibfk_1'), 'submissions', type_='foreignkey')
op.create_foreign_key(None, 'submissions', 'users', ['reviewed_by'], ['id'])
op.drop_column('submissions', 'common_name')
op.drop_column('submissions', 'height')
op.drop_column('submissions', 'container_size')
op.drop_column('submissions', 'timestamp')
op.drop_column('submissions', 'price')
op.drop_column('submissions', 'plant_id')
op.drop_column('submissions', 'width')
op.drop_column('submissions', 'health_status')
op.drop_column('submissions', 'leaf_count')
op.drop_column('submissions', 'potting_mix')
op.drop_column('submissions', 'source')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('submissions', sa.Column('source', mysql.VARCHAR(length=120), nullable=True))
op.add_column('submissions', sa.Column('potting_mix', mysql.VARCHAR(length=255), nullable=True))
op.add_column('submissions', sa.Column('leaf_count', mysql.INTEGER(), autoincrement=False, nullable=True))
op.add_column('submissions', sa.Column('health_status', mysql.VARCHAR(length=50), nullable=True))
op.add_column('submissions', sa.Column('width', mysql.FLOAT(), nullable=True))
op.add_column('submissions', sa.Column('plant_id', mysql.INTEGER(), autoincrement=False, nullable=True))
op.add_column('submissions', sa.Column('price', mysql.FLOAT(), nullable=False))
op.add_column('submissions', sa.Column('timestamp', mysql.DATETIME(), nullable=True))
op.add_column('submissions', sa.Column('container_size', mysql.VARCHAR(length=120), nullable=True))
op.add_column('submissions', sa.Column('height', mysql.FLOAT(), nullable=True))
op.add_column('submissions', sa.Column('common_name', mysql.VARCHAR(length=120), nullable=False))
op.drop_constraint(None, 'submissions', type_='foreignkey')
op.create_foreign_key(op.f('submissions_ibfk_1'), 'submissions', 'plant', ['plant_id'], ['id'])
op.drop_column('submissions', 'reviewed_by')
op.drop_column('submissions', 'approved_at')
op.drop_column('submissions', 'approved')
op.drop_column('submissions', 'plant_name')
op.drop_column('submissions', 'submitted_at')
op.add_column('submission_images', sa.Column('file_path', mysql.VARCHAR(length=255), nullable=False))
op.add_column('submission_images', sa.Column('is_visible', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True))
op.drop_column('submission_images', 'uploaded_at')
op.drop_column('submission_images', 'file_url')
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 39f714eda2bf
Revises: 6420e024f896
Create Date: 2025-06-06 09:50:29.954004
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '39f714eda2bf'
down_revision = '6420e024f896'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 3a0b96235583
Revises: 263b128622a9
Create Date: 2025-06-09 04:13:37.036064
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3a0b96235583'
down_revision = '263b128622a9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 401f262d79cc
Revises: 583fab3f9f80
Create Date: 2025-06-05 04:48:49.440383
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '401f262d79cc'
down_revision = '583fab3f9f80'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 408c432b5835
Revises: 77087ff2442e
Create Date: 2025-06-06 08:34:26.804782
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '408c432b5835'
down_revision = '77087ff2442e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,36 +0,0 @@
"""auto
Revision ID: 447ff559592b
Revises: 408c432b5835
Create Date: 2025-06-06 08:47:25.908940
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '447ff559592b'
down_revision = '408c432b5835'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('submissions', sa.Column('vendor_name', sa.String(length=255), nullable=True))
op.add_column('submissions', sa.Column('rating', sa.Integer(), nullable=True))
op.add_column('submissions', sa.Column('old_vendor', sa.String(length=255), nullable=True))
op.add_column('submissions', sa.Column('new_vendor', sa.String(length=255), nullable=True))
op.add_column('submissions', sa.Column('alias_reason', sa.Text(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('submissions', 'alias_reason')
op.drop_column('submissions', 'new_vendor')
op.drop_column('submissions', 'old_vendor')
op.drop_column('submissions', 'rating')
op.drop_column('submissions', 'vendor_name')
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 460dbe73c1bc
Revises: 3a0b96235583
Create Date: 2025-06-09 04:16:30.838677
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '460dbe73c1bc'
down_revision = '3a0b96235583'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 48d93714beaf
Revises: 761d0f8be3ff
Create Date: 2025-06-05 04:20:31.030479
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '48d93714beaf'
down_revision = '761d0f8be3ff'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 48fee8a8a3be
Revises: af76c66c9075
Create Date: 2025-06-05 00:25:55.439874
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '48fee8a8a3be'
down_revision = 'af76c66c9075'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 4bdec754b085
Revises: 27a65a4e055c
Create Date: 2025-06-05 04:34:19.085549
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4bdec754b085'
down_revision = '27a65a4e055c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 501b54868875
Revises: 401f262d79cc
Create Date: 2025-06-05 04:51:52.183453
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '501b54868875'
down_revision = '401f262d79cc'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 50d5ff358f96
Revises: 1c7cef84b4ae
Create Date: 2025-06-04 22:14:54.902029
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '50d5ff358f96'
down_revision = '1c7cef84b4ae'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: 52e805a0163e
Revises: cb57ad0a3231
Create Date: 2025-06-09 09:48:19.311607
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '52e805a0163e'
down_revision = 'cb57ad0a3231'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: 539c103a1ac4
Revises: b5b29b5b85ae
Create Date: 2025-06-09 10:32:37.666108
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '539c103a1ac4'
down_revision = 'b5b29b5b85ae'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 58022b5ab921
Revises: 50d5ff358f96
Create Date: 2025-06-04 22:32:06.203591
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '58022b5ab921'
down_revision = '50d5ff358f96'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 583fab3f9f80
Revises: 64ec4065d18d
Create Date: 2025-06-05 04:47:05.679772
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '583fab3f9f80'
down_revision = '64ec4065d18d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 58516c9892e9
Revises: 85da58851d35
Create Date: 2025-06-05 05:28:30.947641
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '58516c9892e9'
down_revision = '85da58851d35'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 5c85ebc9451b
Revises: d8bfe4d4c083
Create Date: 2025-06-05 09:47:14.478039
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5c85ebc9451b'
down_revision = 'd8bfe4d4c083'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 6420e024f896
Revises: 7d232205181b
Create Date: 2025-06-06 09:40:37.498453
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6420e024f896'
down_revision = '7d232205181b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,44 +0,0 @@
"""auto
Revision ID: 64c1927562cc
Revises: fb0243eaa7c3
Create Date: 2025-06-06 07:54:00.147383
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '64c1927562cc'
down_revision = 'fb0243eaa7c3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('media', sa.Column('plant_id', sa.Integer(), nullable=True))
op.add_column('media', sa.Column('update_id', sa.Integer(), nullable=True))
op.drop_constraint(op.f('media_ibfk_2'), 'media', type_='foreignkey')
op.drop_constraint(op.f('media_ibfk_3'), 'media', type_='foreignkey')
op.create_foreign_key(None, 'media', 'plant', ['plant_id'], ['id'])
op.create_foreign_key(None, 'media', 'plant_updates', ['update_id'], ['id'])
op.drop_column('media', 'uploader_id')
op.drop_column('media', 'submission_id')
op.drop_column('media', 'caption')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('media', sa.Column('caption', mysql.VARCHAR(length=255), nullable=True))
op.add_column('media', sa.Column('submission_id', mysql.INTEGER(), autoincrement=False, nullable=True))
op.add_column('media', sa.Column('uploader_id', mysql.INTEGER(), autoincrement=False, nullable=False))
op.drop_constraint(None, 'media', type_='foreignkey')
op.drop_constraint(None, 'media', type_='foreignkey')
op.create_foreign_key(op.f('media_ibfk_3'), 'media', 'submissions', ['submission_id'], ['id'])
op.create_foreign_key(op.f('media_ibfk_2'), 'media', 'users', ['uploader_id'], ['id'])
op.drop_column('media', 'update_id')
op.drop_column('media', 'plant_id')
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 64ec4065d18d
Revises: 4bdec754b085
Create Date: 2025-06-05 04:40:02.186807
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '64ec4065d18d'
down_revision = '4bdec754b085'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 6539ef5f5419
Revises: 39f714eda2bf
Create Date: 2025-06-06 10:03:52.256341
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6539ef5f5419'
down_revision = '39f714eda2bf'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 6cb1c3054071
Revises: f4987441cc85
Create Date: 2025-06-06 09:09:55.403015
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6cb1c3054071'
down_revision = 'f4987441cc85'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: 6fcf5e1ad9fa
Revises: a7883990430e
Create Date: 2025-06-09 10:27:44.541187
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6fcf5e1ad9fa'
down_revision = 'a7883990430e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,46 +0,0 @@
"""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 ###

View File

@ -1,93 +0,0 @@
"""auto
Revision ID: 761d0f8be3ff
Revises: ad9ea9d31b58
Create Date: 2025-06-05 04:18:09.403526
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '761d0f8be3ff'
down_revision = 'ad9ea9d31b58'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('plant_lineage')
op.add_column('plant', sa.Column('updated_at', sa.DateTime(), nullable=True))
op.drop_column('plant', 'transferred')
op.drop_column('plant', 'status')
op.drop_column('plant', 'is_verified')
op.drop_column('plant', 'graph_node_id')
op.drop_column('plant', 'notes')
op.add_column('plant_common_name', sa.Column('created_at', sa.DateTime(), nullable=True))
op.alter_column('plant_common_name', 'name',
existing_type=mysql.VARCHAR(length=255),
type_=sa.String(length=128),
existing_nullable=False)
op.add_column('plant_ownership_log', sa.Column('date_acquired', sa.DateTime(), nullable=True))
op.add_column('plant_ownership_log', sa.Column('transferred', sa.Boolean(), nullable=False))
op.add_column('plant_ownership_log', sa.Column('graph_node_id', sa.String(length=255), nullable=True))
op.add_column('plant_ownership_log', sa.Column('is_verified', sa.Boolean(), nullable=False))
op.drop_column('plant_ownership_log', 'start_time')
op.drop_column('plant_ownership_log', 'transfer_note')
op.drop_column('plant_ownership_log', 'end_time')
op.add_column('plant_scientific_name', sa.Column('created_at', sa.DateTime(), nullable=True))
op.alter_column('plant_scientific_name', 'name',
existing_type=mysql.VARCHAR(length=255),
type_=sa.String(length=256),
existing_nullable=False)
op.alter_column('tag', 'name',
existing_type=mysql.VARCHAR(length=255),
type_=sa.String(length=128),
existing_nullable=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('tag', 'name',
existing_type=sa.String(length=128),
type_=mysql.VARCHAR(length=255),
existing_nullable=False)
op.alter_column('plant_scientific_name', 'name',
existing_type=sa.String(length=256),
type_=mysql.VARCHAR(length=255),
existing_nullable=False)
op.drop_column('plant_scientific_name', 'created_at')
op.add_column('plant_ownership_log', sa.Column('end_time', mysql.DATETIME(), nullable=True))
op.add_column('plant_ownership_log', sa.Column('transfer_note', mysql.TEXT(), nullable=True))
op.add_column('plant_ownership_log', sa.Column('start_time', mysql.DATETIME(), nullable=False))
op.drop_column('plant_ownership_log', 'is_verified')
op.drop_column('plant_ownership_log', 'graph_node_id')
op.drop_column('plant_ownership_log', 'transferred')
op.drop_column('plant_ownership_log', 'date_acquired')
op.alter_column('plant_common_name', 'name',
existing_type=sa.String(length=128),
type_=mysql.VARCHAR(length=255),
existing_nullable=False)
op.drop_column('plant_common_name', 'created_at')
op.add_column('plant', sa.Column('notes', mysql.TEXT(), nullable=True))
op.add_column('plant', sa.Column('graph_node_id', mysql.VARCHAR(length=255), nullable=True))
op.add_column('plant', sa.Column('is_verified', mysql.TINYINT(display_width=1), autoincrement=False, nullable=False))
op.add_column('plant', sa.Column('status', mysql.VARCHAR(length=50), nullable=False))
op.add_column('plant', sa.Column('transferred', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True))
op.drop_column('plant', 'updated_at')
op.create_table('plant_lineage',
sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False),
sa.Column('child_plant_id', mysql.INTEGER(), autoincrement=False, nullable=False),
sa.Column('parent_plant_id', mysql.INTEGER(), autoincrement=False, nullable=False),
sa.Column('type', mysql.VARCHAR(length=50), nullable=False),
sa.ForeignKeyConstraint(['child_plant_id'], ['plant.id'], name=op.f('plant_lineage_ibfk_1')),
sa.ForeignKeyConstraint(['parent_plant_id'], ['plant.id'], name=op.f('plant_lineage_ibfk_2')),
sa.PrimaryKeyConstraint('id'),
mysql_collate='utf8mb4_0900_ai_ci',
mysql_default_charset='utf8mb4',
mysql_engine='InnoDB'
)
# ### end Alembic commands ###

View File

@ -1,38 +0,0 @@
"""auto
Revision ID: 77087ff2442e
Revises: 64c1927562cc
Create Date: 2025-06-06 08:10:58.028201
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '77087ff2442e'
down_revision = '64c1927562cc'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('media', sa.Column('uploader_id', sa.Integer(), nullable=False))
op.add_column('media', sa.Column('caption', sa.String(length=255), nullable=True))
op.create_foreign_key(None, 'media', 'users', ['uploader_id'], ['id'])
op.add_column('submissions', sa.Column('submission_type', sa.String(length=50), nullable=False))
op.add_column('submissions', sa.Column('price', sa.Float(), nullable=True))
op.add_column('submissions', sa.Column('source', sa.String(length=255), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('submissions', 'source')
op.drop_column('submissions', 'price')
op.drop_column('submissions', 'submission_type')
op.drop_constraint(None, 'media', type_='foreignkey')
op.drop_column('media', 'caption')
op.drop_column('media', 'uploader_id')
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 7d232205181b
Revises: fad6fe2b5e43
Create Date: 2025-06-06 09:38:39.786953
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7d232205181b'
down_revision = 'fad6fe2b5e43'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: 7d9fc95edc61
Revises: fa3de05c91fb
Create Date: 2025-06-09 10:10:23.833551
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7d9fc95edc61'
down_revision = 'fa3de05c91fb'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 7dbb6d550055
Revises: 72455429fdaf
Create Date: 2025-06-05 05:10:43.392181
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7dbb6d550055'
down_revision = '72455429fdaf'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 7dd0c2491053
Revises: 6539ef5f5419
Create Date: 2025-06-09 02:26:02.002280
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7dd0c2491053'
down_revision = '6539ef5f5419'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 806e94a40aeb
Revises: e1cdc5f78f5e
Create Date: 2025-06-05 01:11:25.968741
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '806e94a40aeb'
down_revision = 'e1cdc5f78f5e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: 80cf84342c5f
Revises: 539c103a1ac4
Create Date: 2025-06-09 10:35:15.685799
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '80cf84342c5f'
down_revision = '539c103a1ac4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 85da58851d35
Revises: 8cd29b8fb6ec
Create Date: 2025-06-05 05:20:46.638884
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '85da58851d35'
down_revision = '8cd29b8fb6ec'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 8605e1ff50cd
Revises: cab9b8b4d05b
Create Date: 2025-06-09 04:53:58.830485
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8605e1ff50cd'
down_revision = 'cab9b8b4d05b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 8cd29b8fb6ec
Revises: 7dbb6d550055
Create Date: 2025-06-05 05:12:50.608338
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8cd29b8fb6ec'
down_revision = '7dbb6d550055'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 90401e0dbe75
Revises: 8605e1ff50cd
Create Date: 2025-06-09 05:15:46.404716
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '90401e0dbe75'
down_revision = '8605e1ff50cd'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 93b893e47742
Revises: b783b3b43713
Create Date: 2025-06-05 02:37:12.714926
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '93b893e47742'
down_revision = 'b783b3b43713'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 9b93a2dffe81
Revises: c1a4158c8226
Create Date: 2025-06-05 01:29:51.402975
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9b93a2dffe81'
down_revision = 'c1a4158c8226'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: 9cff183551e1
Revises: 48fee8a8a3be
Create Date: 2025-06-05 00:32:07.995675
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9cff183551e1'
down_revision = '48fee8a8a3be'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: 9d73ac427e40
Revises: b9234524f710
Create Date: 2025-06-09 08:23:23.453209
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9d73ac427e40'
down_revision = 'b9234524f710'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: a10cbbbeb3f6
Revises: 9d73ac427e40
Create Date: 2025-06-09 08:28:08.962286
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a10cbbbeb3f6'
down_revision = '9d73ac427e40'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: a7883990430e
Revises: 7d9fc95edc61
Create Date: 2025-06-09 10:13:51.730708
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a7883990430e'
down_revision = '7d9fc95edc61'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: ab1a71750f4e
Revises: 52e805a0163e
Create Date: 2025-06-09 09:50:46.848952
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ab1a71750f4e'
down_revision = '52e805a0163e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: ad9ea9d31b58
Revises: 2a0b02a42543
Create Date: 2025-06-05 03:05:30.311725
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ad9ea9d31b58'
down_revision = '2a0b02a42543'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: af76c66c9075
Revises: 58022b5ab921
Create Date: 2025-06-04 22:44:12.056714
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'af76c66c9075'
down_revision = '58022b5ab921'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: b5b29b5b85ae
Revises: 6fcf5e1ad9fa
Create Date: 2025-06-09 10:30:56.308436
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b5b29b5b85ae'
down_revision = '6fcf5e1ad9fa'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: b783b3b43713
Revises: bfc7a6bd8abc
Create Date: 2025-06-05 02:07:18.572162
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b783b3b43713'
down_revision = 'bfc7a6bd8abc'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: b9234524f710
Revises: 13e8b68e0737
Create Date: 2025-06-09 08:19:19.133720
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b9234524f710'
down_revision = '13e8b68e0737'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: b9c03e1ae0bf
Revises: 9b93a2dffe81
Create Date: 2025-06-05 01:37:57.483736
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b9c03e1ae0bf'
down_revision = '9b93a2dffe81'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: bfc7a6bd8abc
Revises: cc35036a6f94
Create Date: 2025-06-05 01:57:23.973531
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bfc7a6bd8abc'
down_revision = 'cc35036a6f94'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: c10353a20277
Revises: e4ece621c461
Create Date: 2025-06-09 09:13:23.016684
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c10353a20277'
down_revision = 'e4ece621c461'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: c1a4158c8226
Revises: 806e94a40aeb
Create Date: 2025-06-05 01:16:54.451574
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c1a4158c8226'
down_revision = '806e94a40aeb'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: c9495b058ab0
Revises: 373571dfe134
Create Date: 2025-06-05 09:42:35.228096
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c9495b058ab0'
down_revision = '373571dfe134'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: cab9b8b4d05b
Revises: 1edc2e2c93cd
Create Date: 2025-06-09 04:42:01.258302
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cab9b8b4d05b'
down_revision = '1edc2e2c93cd'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: cb3ce762cabb
Revises: ab1a71750f4e
Create Date: 2025-06-09 09:57:52.586507
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cb3ce762cabb'
down_revision = 'ab1a71750f4e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: cb57ad0a3231
Revises: 1f5b1e0b6b05
Create Date: 2025-06-09 09:44:00.832472
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cb57ad0a3231'
down_revision = '1f5b1e0b6b05'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: cc35036a6f94
Revises: b9c03e1ae0bf
Create Date: 2025-06-05 01:45:09.251040
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cc35036a6f94'
down_revision = 'b9c03e1ae0bf'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: d11c2e8b173a
Revises: 01e2d617ae49
Create Date: 2025-06-09 04:31:08.076159
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd11c2e8b173a'
down_revision = '01e2d617ae49'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: d8bfe4d4c083
Revises: c9495b058ab0
Create Date: 2025-06-05 09:44:47.740029
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd8bfe4d4c083'
down_revision = 'c9495b058ab0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,37 +0,0 @@
"""auto
Revision ID: e0afd892f86e
Revises: 7dd0c2491053
Create Date: 2025-06-09 02:37:06.190352
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e0afd892f86e'
down_revision = '7dd0c2491053'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('import_batches',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('export_id', sa.String(length=64), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('imported_at', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('export_id', 'user_id', name='uix_export_user')
)
op.create_index(op.f('ix_import_batches_user_id'), 'import_batches', ['user_id'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_import_batches_user_id'), table_name='import_batches')
op.drop_table('import_batches')
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: e1cdc5f78f5e
Revises: 2fa6feb17477
Create Date: 2025-06-05 00:57:10.914714
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e1cdc5f78f5e'
down_revision = '2fa6feb17477'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,70 +0,0 @@
"""auto
Revision ID: e34cff15a95e
Revises: 5c85ebc9451b
Create Date: 2025-06-06 07:34:33.699976
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'e34cff15a95e'
down_revision = '5c85ebc9451b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('featured_images', sa.Column('media_id', sa.Integer(), nullable=False))
op.drop_constraint(op.f('featured_images_ibfk_1'), 'featured_images', type_='foreignkey')
op.create_foreign_key(None, 'featured_images', 'media', ['media_id'], ['id'])
op.drop_column('featured_images', 'submission_image_id')
op.add_column('image_hearts', sa.Column('media_id', sa.Integer(), nullable=False))
op.drop_constraint(op.f('image_hearts_ibfk_1'), 'image_hearts', type_='foreignkey')
op.create_foreign_key(None, 'image_hearts', 'media', ['media_id'], ['id'])
op.drop_column('image_hearts', 'submission_image_id')
op.add_column('media', sa.Column('uploader_id', sa.Integer(), nullable=False))
op.add_column('media', sa.Column('submission_id', sa.Integer(), nullable=True))
op.drop_constraint(op.f('media_ibfk_2'), 'media', type_='foreignkey')
op.drop_constraint(op.f('media_ibfk_3'), 'media', type_='foreignkey')
op.create_foreign_key(None, 'media', 'users', ['uploader_id'], ['id'])
op.create_foreign_key(None, 'media', 'submissions', ['submission_id'], ['id'])
op.drop_column('media', 'update_id')
op.drop_column('media', 'plant_id')
op.add_column('submissions', sa.Column('submission_type', sa.String(length=50), nullable=False))
op.add_column('submissions', sa.Column('price', sa.Float(), nullable=True))
op.add_column('submissions', sa.Column('source', sa.String(length=255), nullable=True))
op.alter_column('submissions', 'plant_name',
existing_type=mysql.VARCHAR(length=100),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('submissions', 'plant_name',
existing_type=mysql.VARCHAR(length=100),
nullable=False)
op.drop_column('submissions', 'source')
op.drop_column('submissions', 'price')
op.drop_column('submissions', 'submission_type')
op.add_column('media', sa.Column('plant_id', mysql.INTEGER(), autoincrement=False, nullable=True))
op.add_column('media', sa.Column('update_id', mysql.INTEGER(), autoincrement=False, nullable=True))
op.drop_constraint(None, 'media', type_='foreignkey')
op.drop_constraint(None, 'media', type_='foreignkey')
op.create_foreign_key(op.f('media_ibfk_3'), 'media', 'plant_updates', ['update_id'], ['id'])
op.create_foreign_key(op.f('media_ibfk_2'), 'media', 'plant', ['plant_id'], ['id'])
op.drop_column('media', 'submission_id')
op.drop_column('media', 'uploader_id')
op.add_column('image_hearts', sa.Column('submission_image_id', mysql.INTEGER(), autoincrement=False, nullable=False))
op.drop_constraint(None, 'image_hearts', type_='foreignkey')
op.create_foreign_key(op.f('image_hearts_ibfk_1'), 'image_hearts', 'submission_images', ['submission_image_id'], ['id'])
op.drop_column('image_hearts', 'media_id')
op.add_column('featured_images', sa.Column('submission_image_id', mysql.INTEGER(), autoincrement=False, nullable=False))
op.drop_constraint(None, 'featured_images', type_='foreignkey')
op.create_foreign_key(op.f('featured_images_ibfk_1'), 'featured_images', 'submission_images', ['submission_image_id'], ['id'])
op.drop_column('featured_images', 'media_id')
# ### end Alembic commands ###

View File

@ -0,0 +1,28 @@
"""auto
Revision ID: e4ece621c461
Revises: a10cbbbeb3f6
Create Date: 2025-06-09 08:55:16.262879
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e4ece621c461'
down_revision = 'a10cbbbeb3f6'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('media', sa.Column('created_at', sa.DateTime(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('media', 'created_at')
# ### end Alembic commands ###

View File

@ -1,28 +0,0 @@
"""auto
Revision ID: f4987441cc85
Revises: 447ff559592b
Create Date: 2025-06-06 08:59:55.024371
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f4987441cc85'
down_revision = '447ff559592b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@ -1,8 +1,8 @@
"""auto
Revision ID: 4d9859ada63b
Revision ID: fa22b011d450
Revises:
Create Date: 2025-06-04 06:16:08.829142
Create Date: 2025-06-09 06:59:45.406606
"""
from alembic import op
@ -10,7 +10,7 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4d9859ada63b'
revision = 'fa22b011d450'
down_revision = None
branch_labels = None
depends_on = None
@ -18,18 +18,26 @@ depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('import_batches',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('export_id', sa.String(length=64), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('imported_at', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('export_id', 'user_id', name='uix_export_user')
)
op.create_index(op.f('ix_import_batches_user_id'), 'import_batches', ['user_id'], unique=False)
op.create_table('plant_common_name',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=255), nullable=False),
sa.Column('name', sa.String(length=128), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name'),
sa.UniqueConstraint('name')
)
op.create_table('tag',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=255), nullable=False),
sa.Column('name', sa.String(length=128), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name'),
sa.UniqueConstraint('name')
)
op.create_table('users',
@ -41,18 +49,39 @@ def upgrade():
sa.Column('excluded_from_analytics', sa.Boolean(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email'),
sa.UniqueConstraint('email')
)
op.create_table('plant_scientific_name',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=255), nullable=False),
sa.Column('name', sa.String(length=256), nullable=False),
sa.Column('common_id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['common_id'], ['plant_common_name.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name'),
sa.UniqueConstraint('name')
)
op.create_table('submissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('submitted_at', sa.DateTime(), nullable=True),
sa.Column('plant_name', sa.String(length=100), nullable=True),
sa.Column('scientific_name', sa.String(length=120), nullable=True),
sa.Column('notes', sa.Text(), nullable=True),
sa.Column('submission_type', sa.String(length=50), nullable=False),
sa.Column('price', sa.Float(), nullable=True),
sa.Column('source', sa.String(length=255), nullable=True),
sa.Column('vendor_name', sa.String(length=255), nullable=True),
sa.Column('rating', sa.Integer(), nullable=True),
sa.Column('old_vendor', sa.String(length=255), nullable=True),
sa.Column('new_vendor', sa.String(length=255), nullable=True),
sa.Column('alias_reason', sa.Text(), nullable=True),
sa.Column('approved', sa.Boolean(), nullable=True),
sa.Column('approved_at', sa.DateTime(), nullable=True),
sa.Column('reviewed_by', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['reviewed_by'], ['users.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('plant',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('uuid', sa.String(length=36), nullable=False),
@ -61,20 +90,24 @@ def upgrade():
sa.Column('common_id', sa.Integer(), nullable=False),
sa.Column('scientific_id', sa.Integer(), nullable=False),
sa.Column('plant_type', sa.String(length=50), nullable=False),
sa.Column('status', sa.String(length=50), nullable=False),
sa.Column('notes', sa.Text(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('transferred', sa.Boolean(), nullable=True),
sa.Column('graph_node_id', sa.String(length=255), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.Column('data_verified', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['common_id'], ['plant_common_name.id'], ),
sa.ForeignKeyConstraint(['owner_id'], ['users.id'], ),
sa.ForeignKeyConstraint(['scientific_id'], ['plant_scientific_name.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('custom_slug'),
sa.UniqueConstraint('custom_slug'),
sa.UniqueConstraint('uuid'),
sa.UniqueConstraint('uuid')
)
op.create_table('submission_images',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('submission_id', sa.Integer(), nullable=False),
sa.Column('file_url', sa.String(length=256), nullable=False),
sa.Column('uploaded_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['submission_id'], ['submissions.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('grow_logs',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('plant_id', sa.Integer(), nullable=False),
@ -83,22 +116,13 @@ def upgrade():
sa.ForeignKeyConstraint(['plant_id'], ['plant.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('plant_lineage',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('child_plant_id', sa.Integer(), nullable=False),
sa.Column('parent_plant_id', sa.Integer(), nullable=False),
sa.Column('type', sa.String(length=50), nullable=False),
sa.ForeignKeyConstraint(['child_plant_id'], ['plant.id'], ),
sa.ForeignKeyConstraint(['parent_plant_id'], ['plant.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('plant_ownership_log',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('plant_id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('start_time', sa.DateTime(), nullable=False),
sa.Column('end_time', sa.DateTime(), nullable=True),
sa.Column('transfer_note', sa.Text(), nullable=True),
sa.Column('date_acquired', sa.DateTime(), nullable=True),
sa.Column('transferred', sa.Boolean(), nullable=False),
sa.Column('is_verified', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['plant_id'], ['plant.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
@ -110,24 +134,19 @@ def upgrade():
sa.ForeignKeyConstraint(['tag_id'], ['tag.id'], ),
sa.PrimaryKeyConstraint('plant_id', 'tag_id')
)
op.create_table('submissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('plant_id', sa.Integer(), nullable=True),
sa.Column('common_name', sa.String(length=120), nullable=False),
sa.Column('scientific_name', sa.String(length=120), nullable=True),
sa.Column('price', sa.Float(), nullable=False),
sa.Column('source', sa.String(length=120), nullable=True),
sa.Column('timestamp', sa.DateTime(), nullable=True),
sa.Column('height', sa.Float(), nullable=True),
sa.Column('width', sa.Float(), nullable=True),
sa.Column('leaf_count', sa.Integer(), nullable=True),
sa.Column('potting_mix', sa.String(length=255), nullable=True),
sa.Column('container_size', sa.String(length=120), nullable=True),
sa.Column('health_status', sa.String(length=50), nullable=True),
sa.Column('notes', sa.Text(), nullable=True),
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(['user_id'], ['users.id'], ),
sa.ForeignKeyConstraint(['seller_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('plant_updates',
@ -141,62 +160,58 @@ def upgrade():
sa.ForeignKeyConstraint(['plant_id'], ['plant.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('submission_images',
op.create_table('media',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('submission_id', sa.Integer(), nullable=False),
sa.Column('file_path', sa.String(length=255), nullable=False),
sa.Column('is_visible', sa.Boolean(), nullable=True),
sa.ForeignKeyConstraint(['submission_id'], ['submissions.id'], ),
sa.Column('file_url', sa.String(length=256), nullable=False),
sa.Column('uploaded_at', sa.DateTime(), nullable=True),
sa.Column('uploader_id', sa.Integer(), nullable=False),
sa.Column('caption', sa.String(length=255), nullable=True),
sa.Column('plant_id', sa.Integer(), nullable=True),
sa.Column('growlog_id', sa.Integer(), nullable=True),
sa.Column('update_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['growlog_id'], ['grow_logs.id'], ),
sa.ForeignKeyConstraint(['plant_id'], ['plant.id'], ),
sa.ForeignKeyConstraint(['update_id'], ['plant_updates.id'], ),
sa.ForeignKeyConstraint(['uploader_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('featured_images',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('submission_image_id', sa.Integer(), nullable=False),
sa.Column('media_id', sa.Integer(), nullable=False),
sa.Column('override_text', sa.String(length=255), nullable=True),
sa.Column('is_featured', sa.Boolean(), nullable=True),
sa.ForeignKeyConstraint(['submission_image_id'], ['submission_images.id'], ),
sa.ForeignKeyConstraint(['media_id'], ['media.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('image_hearts',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('submission_image_id', sa.Integer(), nullable=False),
sa.Column('media_id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['submission_image_id'], ['submission_images.id'], ),
sa.ForeignKeyConstraint(['media_id'], ['media.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('media',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('file_url', sa.String(length=256), nullable=False),
sa.Column('uploaded_at', sa.DateTime(), nullable=True),
sa.Column('plant_id', sa.Integer(), nullable=True),
sa.Column('growlog_id', sa.Integer(), nullable=True),
sa.Column('update_id', sa.Integer(), nullable=True),
sa.Column('caption', sa.String(length=255), nullable=True),
sa.ForeignKeyConstraint(['growlog_id'], ['grow_logs.id'], ),
sa.ForeignKeyConstraint(['plant_id'], ['plant.id'], ),
sa.ForeignKeyConstraint(['update_id'], ['plant_updates.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('media')
op.drop_table('image_hearts')
op.drop_table('featured_images')
op.drop_table('submission_images')
op.drop_table('media')
op.drop_table('plant_updates')
op.drop_table('submissions')
op.drop_table('transfer_request')
op.drop_table('plant_tags')
op.drop_table('plant_ownership_log')
op.drop_table('plant_lineage')
op.drop_table('grow_logs')
op.drop_table('submission_images')
op.drop_table('plant')
op.drop_table('submissions')
op.drop_table('plant_scientific_name')
op.drop_table('users')
op.drop_table('tag')
op.drop_table('plant_common_name')
op.drop_index(op.f('ix_import_batches_user_id'), table_name='import_batches')
op.drop_table('import_batches')
# ### end Alembic commands ###

View File

@ -0,0 +1,38 @@
"""auto
Revision ID: fa3de05c91fb
Revises: cb3ce762cabb
Create Date: 2025-06-09 10:06:16.352992
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'fa3de05c91fb'
down_revision = 'cb3ce762cabb'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('plant', sa.Column('mother_uuid', sa.String(length=36), nullable=True))
op.add_column('plant', sa.Column('notes', sa.Text(), nullable=True))
op.add_column('plant', sa.Column('is_active', sa.Boolean(), nullable=False))
op.add_column('plant', sa.Column('featured_media_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'plant', 'media', ['featured_media_id'], ['id'])
op.create_foreign_key(None, 'plant', 'plant', ['mother_uuid'], ['uuid'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'plant', type_='foreignkey')
op.drop_constraint(None, 'plant', type_='foreignkey')
op.drop_column('plant', 'featured_media_id')
op.drop_column('plant', 'is_active')
op.drop_column('plant', 'notes')
op.drop_column('plant', 'mother_uuid')
# ### end Alembic commands ###

View File

@ -1,32 +0,0 @@
"""auto
Revision ID: fad6fe2b5e43
Revises: 6cb1c3054071
Create Date: 2025-06-06 09:24:38.663461
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'fad6fe2b5e43'
down_revision = '6cb1c3054071'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('submissions', 'plant_name',
existing_type=mysql.VARCHAR(length=100),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('submissions', 'plant_name',
existing_type=mysql.VARCHAR(length=100),
nullable=False)
# ### end Alembic commands ###

View File

@ -1,38 +0,0 @@
"""auto
Revision ID: fb0243eaa7c3
Revises: e34cff15a95e
Create Date: 2025-06-06 07:43:42.387700
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'fb0243eaa7c3'
down_revision = 'e34cff15a95e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('submissions', 'plant_name',
existing_type=mysql.VARCHAR(length=100),
nullable=False)
op.drop_column('submissions', 'price')
op.drop_column('submissions', 'source')
op.drop_column('submissions', 'submission_type')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('submissions', sa.Column('submission_type', mysql.VARCHAR(length=50), nullable=False))
op.add_column('submissions', sa.Column('source', mysql.VARCHAR(length=255), nullable=True))
op.add_column('submissions', sa.Column('price', mysql.FLOAT(), nullable=True))
op.alter_column('submissions', 'plant_name',
existing_type=mysql.VARCHAR(length=100),
nullable=True)
# ### end Alembic commands ###