Class: LinkSetup
- Inherits:
-
Sequel::Migration
- Object
- Sequel::Migration
- LinkSetup
- Defined in:
- lib/runtime/link.rb
Overview
The LinkSetup 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
44 45 46 |
# File 'lib/runtime/link.rb', line 44 def down drop_table :link if table_exists? :link end |
#up ⇒ Object
rubocop: disable Metrics/MethodLength
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/runtime/link.rb', line 27 def up # return if table_exists? :link log.debug "#up" create_table? :link do primary_key :id foreign_key :from_id, :object, on_delete: :cascade foreign_key :to_id, :object, on_delete: :cascade index :name index :created_at String :name DateTime :created_at DateTime :modified_at end end |