Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noahvdaa/schemashift
A tiny, simple migration framework for Java.
https://github.com/noahvdaa/schemashift
Last synced: 9 days ago
JSON representation
A tiny, simple migration framework for Java.
- Host: GitHub
- URL: https://github.com/noahvdaa/schemashift
- Owner: NoahvdAa
- Created: 2023-08-17T17:04:52.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-29T12:56:11.000Z (7 months ago)
- Last Synced: 2024-10-27T06:28:27.501Z (24 days ago)
- Language: Java
- Homepage:
- Size: 125 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SchemaShift
SchemaShift is a tiny, simple migration framework for Java. It's designed for use with MariaDB/MySQL databases, but
other database systems with a compatible syntax should also work.## Usage
```java
SchemaShift migrator = SchemaShift.with(myConnection);// Directly create a migration from a query
migrator.registerMigration(Migration.fromQuery(
"2023_08_01_add_mytable",
"CREATE TABLE IF NOT EXISTS `mytable` ( ... );"
));// Or read from a resource:
migrator.registerMigration(
Migration.fromResource("2023_08_02_add_another_table.sql")
);// Or read an entire folder of resources!
migrator.registerMigrations(
Migration.fromResourceFolder("migrations")
);migrator.migrateLatest();
```## Download
SchemaShift is currently in development, so snapshots are deployed to the bytecode.space snapshots repository, which you
must manually add to your build tool's repositories section:```kotlin
repositories {
maven {
url = uri("https://repo.bytecode.space/repository/maven-public/")
}
}
``````xml
bytecodespace
https://repo.bytecode.space/repository/maven-public/
```
Add the dependency:
```kotlin
dependencies {
implementation("me.noahvdaa:schemashift:1.0.0-SNAPSHOT")
}
``````xml
me.noahvdaa
schemashift
1.0.0-SNAPSHOT
```