-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema Manager #12
Comments
Hi, thank you for creating all these great libs, I'm really happy to see progress on this! 🚀 Not certain if this was brought up before, but I think it could be beneficial to support:
A disadvantage I see is that adding these functions breaks the strict structure the current implementation enforces. On the other hand, it might help people to experiment with this tool stack as their current migrations might be plain SQL. Not supporting this would require them to rewrite everything in plain Rust just to test a few things. Personally, I also prefer writing my migrations in plain SQL, so that's also a reason why I raised this :D |
Hey @JonasCir, nice observations! This is actually supported, you can define migration with raw SQL in string literal or from SQL file using sea-schema/src/migration/manager.rs Lines 20 to 28 in 3309d13
|
Hi thanks for the prompt answer, happy to see it being supported then 👍 |
This looks like a related effort that can be reused: https://github.com/rust-db/refinery |
To support SeaORM, we want to develop SeaSchema into a fully-featured schema manager.
Functionalities:
Migration Manager
The migration manager would work like
sqlx-cli
migration, keeping track of executed migrations.Our private table would be named
seaql_migrations
.The migration 'script' would look like:
Migration Codegen
The migration should scaffold a rust project with the following structure:
The project would serve two functions: as an executable to be executed:
cd migration cargo run -- run
On the other hand, it can also be used as a library, to be required by the web server when deployed:
Schema Manager
The
SchemaManager
will provide 3 categories of APIs:The text was updated successfully, but these errors were encountered: