How to customize Table name in Cequel?

125 Views Asked by At

For a Cequel record/schema, the name is generated by rake cequel:migrate. But how do we assign a name in the model definition?

I tried the following but it did not work (Cequel 1.7.0):

class MyInfo
  include Cequel::Record

  key :name, :text
  column :info, :text

  self.table_name = "my_info_2" #<<< need to set a custom name

end
1

There are 1 best solutions below

0
On

The updated cequel version 1.9.1 has the custom naming enabled. It is also confirmed by the author on GitHub/Cequel:

    The self.table_name = ... syntax works for the current version (1.9.1).
A lot of improvements have been made in the 9 months since 1.7.0 was released.
Any chance you could upgrade?