Module: RubyCms::MigrationHelpers

Defined in:
lib/ruby_cms/migration_helpers.rb

Overview

Shared helpers for CMS migrations (json on SQLite, jsonb on PostgreSQL).

Class Method Summary collapse

Class Method Details

.json_column(table, name, **options) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/ruby_cms/migration_helpers.rb', line 8

def json_column(table, name, **options)
  if table.respond_to?(:jsonb)
    table.jsonb(name, **options)
  else
    table.json(name, **options)
  end
end