# Hanami 1.3 -\> Hanami 2.0

**URL:** <https://discourse.hanakai.org/t/hanami-1-3-hanami-2-0/702>\
**Category:** questions\
**Created:** [August 5, 2022, 11:21pm UTC](https://discourse.hanakai.org/t/hanami-1-3-hanami-2-0/702 "2022-08-05T23:21:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![swilgosz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.hanakai.org/swilgosz/32/484_2.png) [@swilgosz](https://discourse.hanakai.org/u/swilgosz)\
**Post date:** [August 5, 2022, 11:28pm UTC](https://discourse.hanakai.org/t/hanami-1-3-hanami-2-0/702/2 "2022-08-05T23:28:52Z")

</div>

**My first trouble:**

I have JSONB columns in my entities. Before, reading them by Hanami::Model, resulted in a hash. After switching to ROM, the column read from DB returns JSON.

```ruby
# Before (Hanami::Model)
message.payload
# => { author: "Jsmith", content: "My message" }

# After (ROM 5.0)

# frozen_string_literal: true

module Entities
  class Message < ROM::Struct
  end
end

# frozen_string_literal: true

module Persistence
  module Relations
    class Messages < ROM::Relation[:sql]
      schema(:messages, infer: true)

      auto_struct true
    end
  end
end

class MessageRepository < Rom::Repository[:messages]
end

MessageRepository.new.messages.first.payload
# => "{\"author\":\"Jsmith\",\"content\":\"My message\"}"

```

Question: How I should configure a Mapper for all JSONB columns in my system at once?

---

_[View the full topic](https://discourse.hanakai.org/t/hanami-1-3-hanami-2-0/702)._
