-
Notifications
You must be signed in to change notification settings - Fork 17
Configuration
You can configure harmonica in build.gradle as follows.
You can specify the path of the migration files from the project root directory.
extensions.extraProperties["directoryPath"] =
"src/main/kotlin/com/improve_future/harmonica_test/jarmonica"When you specify it, the migration package name is automatically changed according to its path.
You can specify the package name of the migration files.
extensions.extraProperties["migrationPackage"] =
[project.group, project.rootProject.name, project.name].join(".")When you specify it, the migration package name is automatically changed according to its path. If you specify the path, too, the automatic configuration is invalid.
This feature is available in Jarmonica from 1.1.19,
If you configure as follows, refer method control reference column.
extensions.extraProperties["tableNamePluralization"] = trueThis library is designed to use with singular table names, such as user table, session table and so on.
So refer("users") creates users_id column.
But some people use plural table names, such as users table, sessions table and so on, and they prefer the reference column composed of the singular name and "id" such as "user_id".
To create such column, you must write like refer("users", columnName = "user_id") unless configure tableNamePluralization.
If you set the preceding configuration, the column user_id is created when you write only refer("users").