Skip to content
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

README: Minor wording changes #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ Add the following Maven **runtime** dependency to your project:

### Hibernate

Users of Hibernate typically annotate the enum columns with
For Hibernate entities, we recommend annotating attributes of enum type as shown below:
```java
@JdbcType(PostgreSQLEnumJdbcType.class)
Status status;
```
where `Status` is an enum class.

## Commands ##

The library provides additional liquibase commands, that can be used within a `changeSet`:

### Creating an enum type

```xml
Expand All @@ -55,8 +56,8 @@ where `Status` is an enum class.

### Removing one or more values of an existing enum

PostgreSQL does not yet support removing of values of an existing enum. Instead, we implement a workaround described in
https://blog.yo1.dog/updating-enum-values-in-postgresql-the-safe-and-easy-way/ by replacing the enum with a new enum type that has different values.
PostgreSQL does not yet support removing of values of an existing enum. Instead, we implement a workaround
by replacing the enum with a new enum type that has different values (as described in [this blog post][yo1dog-blog]).

⚠ You need to be extra careful when you drop an enum value! First, you need to update the existing tables
to make sure that the value is not used anymore, typically using an `UPDATE` statement.
Expand Down Expand Up @@ -84,3 +85,4 @@ to make sure that the value is not used anymore, typically using an `UPDATE` sta

[postgresql-enums]: https://www.postgresql.org/docs/current/datatype-enum.html
[liquibase-changelog-generator]: https://github.com/cronn/liquibase-changelog-generator
[yo1dog-blog]: https://blog.yo1.dog/updating-enum-values-in-postgresql-the-safe-and-easy-way/
Loading