Module: EnhancedSQLite3::SupportsDeferrableConstraints::SchemaCreation

Defined in:
lib/enhanced_sqlite3/supports_deferrable_constraints.rb

Instance Method Summary collapse

Instance Method Details

#visit_AddForeignKey(o) ⇒ Object



98
99
100
101
102
# File 'lib/enhanced_sqlite3/supports_deferrable_constraints.rb', line 98

def visit_AddForeignKey(o)
  super.dup.tap do |sql|
    sql << " DEFERRABLE INITIALLY #{o.options[:deferrable].to_s.upcase}" if o.deferrable
  end
end

#visit_ForeignKeyDefinition(o) ⇒ Object



104
105
106
107
108
# File 'lib/enhanced_sqlite3/supports_deferrable_constraints.rb', line 104

def visit_ForeignKeyDefinition(o)
  super.dup.tap do |sql|
    sql << " DEFERRABLE INITIALLY #{o.deferrable.to_s.upcase}" if o.deferrable
  end
end