method

visit_ForeignKeyDefinition

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v6.0.0) is shown here.

visit_ForeignKeyDefinition(o)
private

No documentation available.

# File activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb, line 67
          def visit_ForeignKeyDefinition(o)
            sql = +<<~SQL
              CONSTRAINT #{quote_column_name(o.name)}
              FOREIGN KEY (#{quote_column_name(o.column)})
                REFERENCES #{quote_table_name(o.to_table)} (#{quote_column_name(o.primary_key)})
            SQL
            sql << " #{action_sql('DELETE', o.on_delete)}" if o.on_delete
            sql << " #{action_sql('UPDATE', o.on_update)}" if o.on_update
            sql
          end