Class: ObjectSetup
- Inherits:
-
Sequel::Migration
- #Object
- Object
- Sequel::Migration
- ObjectSetup
- Defined in:
- lib/story_teller/inform/relational/object.rb
Overview
The ObjectSetup class
Instance Method Summary collapse
-
#down ⇒ Object
rubocop: enable Metrics/MethodLength.
-
#up ⇒ Object
rubocop: disable Metrics/MethodLength.
Methods inherited from Sequel::Migration
Instance Method Details
#down ⇒ Object
rubocop: enable Metrics/MethodLength
48 49 50 |
# File 'lib/story_teller/inform/relational/object.rb', line 48 def down drop_table(:object, cascade: true) if table_exists? :object end |
#up ⇒ Object
rubocop: disable Metrics/MethodLength
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/story_teller/inform/relational/object.rb', line 30 def up create_table? :object do primary_key :id foreign_key :parent_id, :object, on_delete: :set_null index :name index :created_at String :name, text: true String :short_name, text: true String :description, text: true String :object_type, null: false String :properties, text: true, default: {}.to_yaml.strip DateTime :created_at DateTime :modified_at end end |