dbos-inc / dbos-transact-py

Ultra-Lightweight Durable Execution in Python
https://docs.dbos.dev
MIT License
244 stars 7 forks source link

rename app database index #126

Closed ananis25 closed 3 weeks ago

ananis25 commented 1 month ago

This PR renames the index name for the transactions-output tables in the Application database.

This will also unlock using the same database as app and system database for DBOS, even if ill-advised.

kraftp commented 4 weeks ago

Thanks for the PR! Have you confirmed that the migration works on an existing app though? I suspect it won't because the migrations run in the system database but the index is in the app database.

ananis25 commented 4 weeks ago

Ah, thats why alembic couldn't generate a migration automatically, I just wrote the migration file by hand. Makes sense that DBOS won't generate migrations in the app database, just make sure the table exists.

This change doesn't really need to affect existing deployments, so we could just leave those? Else we could add a conditional to the DBOS migrate cli I think.

ananis25 commented 3 weeks ago

Yep, I tried it with a couple small apps. The sqlalchemy create_all call when initializing the application database doesn't actually run if the table already exists. So, existing applications aren't affected.