Module: Ruote::Sequel
- Defined in:
- lib/ruote/sequel/storage.rb,
lib/ruote/sequel/version.rb
Defined Under Namespace
Classes: Storage
Constant Summary collapse
- VERSION =
'2.3.0.2'
Class Method Summary collapse
-
.create_table(sequel, re_create = false, table_name = 'documents') ⇒ Object
Creates the ‘documents’ table necessary for this storage.
Class Method Details
.create_table(sequel, re_create = false, table_name = 'documents') ⇒ Object
Creates the ‘documents’ table necessary for this storage.
If re_create is set to true, it will destroy any previous ‘documents’ table and create it. If false (default) then the table will be created if it doesn’t already exist.
It’s also possible to change the default table_name from ‘documents’ to something else with the optional third parameter
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ruote/sequel/storage.rb', line 42 def self.create_table(sequel, re_create=false, table_name='documents') m = re_create ? :create_table! : :create_table? sequel.send(m, table_name.to_sym) do String :ide, :size => 255, :null => false Integer :rev, :null => false String :typ, :size => 55, :null => false String :doc, :text => true, :null => false String :wfid, :size => 255 String :participant_name, :size => 512 primary_key [ :typ, :ide, :rev ] index :wfid #index [ :typ, :wfid ] end end |