3 unstable releases
new 0.3.0 | Feb 15, 2025 |
---|---|
0.2.1 | Feb 14, 2025 |
0.2.0 | Feb 13, 2025 |
#1189 in Database interfaces
353 downloads per month
35KB
777 lines
sql-schema
This crate provides tools for generating schema migrations based on edits to a canonical schema file.
Status
This crate is in a very early stage of development and is missing many features.
Usage
# install the cli
cargo install sql-schema
# generate a schema file from existing migrations
sql-schema schema \
--schema-path ./schema/schema.sql \ # this is the default value
--migrations-dir ./schema/migrations # this is the default value
# -> writing ./schema/schema.sql
# generate a migration after editing the schema file
sql-schema migration --name my_new_migration \
--include-down true \ # default is true if any down migration exists
--schema-path ./schema/schema.sql \ # this is the default value
--migrations-dir ./schema/migrations # this is the default value
# -> writing schema/migrations/1739486729_my_new_migration.up.sql
# -> writing schema/migrations/1739486729_my_new_migration.down.sql
Licensing
All code in this repository is licensed under the Apache Software License 2.0.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.
Dependencies
~6MB
~125K SLoC