Skip to content

Conversation

@deep1401
Copy link
Member

  • Handle existing tables
  • Handle old existing user schema

@deep1401 deep1401 marked this pull request as draft November 21, 2025 22:25
@deep1401 deep1401 marked this pull request as ready for review November 21, 2025 22:28
@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 62.50000% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
api/transformerlab/db/session.py 52.94% 7 Missing and 1 partial ⚠️
api/transformerlab/shared/models/user_model.py 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

op.create_index(op.f("ix_config_key"), "config", ["key"], unique=True)

# Plugin table
if not table_exists("plugins"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to make a PR to remove plugins and training_templates from our code base. Since we're doing this as a sort of clean start let's not even bother putting them in the initial migration?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could just remove the definition directly in this PR itself and have the initial migration just drop those tables if they exist

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think remove the definition. I'm not sure if it's necessary to drop the table or not. I guess there's no point in letting them hang around and possibly cause problems later.
Maybe in the future we remove all of the "old schema" cleanup.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay will cleanup the definition and just drop those.
I can wait and let you confirm for workflow and workflowruns before doing those two as well

op.create_index(op.f("ix_training_template_updated_at"), "training_template", ["updated_at"], unique=False)

# Workflow table
if not table_exists("workflows"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workflows and Workflow Runs are a little trickier. I'd love to eliminate them from the initial migration as well but I don't know with absolute certainty that we never hit the tables. Maybe I will try to clean that up today as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a function in the env.py of alembic to not track workflow and workflow_runs tables so we might not have to purge things for those

@dadmobile
Copy link
Member

Tested this with the old user schema and it worked (deleted old table and migrated).

output = f.read()
return output
return ""
# @router.get("/{job_id}/output")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not used anymore? I was trying to figure out what was going on with the calls to training template in here!

If we do remove this it is causing ruff errors as a head's up!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was only being used in ViewOutputModal under Training but we dont use that modal anymore since we switched to ViewOutputModalStreaming so I deleted that modal too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I think we should just delete this then instead of commenting out. We can always go look it up in git history if we need it.

datasets = configObject["dataset_name"]
await db.create_training_template(name, description, type, datasets, config)
return {"message": "OK"}
# @router.post("/template/create")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just delete this. No point leaving most of the file commented out. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

output = f.read()
return output
return ""
# @router.get("/{job_id}/output")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I think we should just delete this then instead of commenting out. We can always go look it up in git history if we need it.

@deep1401 deep1401 requested a review from dadmobile November 24, 2025 17:09
@deep1401
Copy link
Member Author

Made the requested change now

@deep1401 deep1401 merged commit 3fd1634 into main Nov 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants