续集迁移:未初始化的常量Jsonb(NameError)

时间:2016-03-27 04:28:15

标签: ruby postgresql sequel padrino

我将SequelPadrino一起使用,以下迁移引发了uninitialized constant Jsonb (NameError)错误:

Sequel.migration do
  up do
    alter_table :same_table do
      add_column :not_working, Jsonb
    end
  end
end

销售表的create_table迁移使用了Jsonb而没有问题:

Sequel.migration do
  up do
    create_table :same_table do
      Jsonb :worked
    end
  end
end

1 个答案:

答案 0 :(得分:2)

Sequel source code所示,列类型不应大写。通常,DSL是关于定义类方法,而不是常量。

clear
set more off

*----- example data -----

sysuse auto

*----- two-variable example -----

eststo clear

// process price
estpost summarize price
matrix mymat = e(mean), e(count)

// process mpg
estpost summarize mpg if mpg > 15
matrix mymat = mymat \ e(mean), e(count)

// finish formatting matrix
matrix colnames mymat = mean count
matrix rownames mymat = price mpg
matrix list mymat

// tabulate
esttab matrix(mymat), nomtitles