class

Ralph::Migrations::Schema::ForeignKeyDefinition

Inherits Reference / Object

Represents a foreign key constraint

Foreign keys enforce referential integrity at the database level.

Constructors

new(from_table : String, from_column : String, to_table : String, to_column : String = "id", on_delete : Symbol | Nil = nil, on_update : Symbol | Nil = nil, name : String | Nil = nil)
Source

Instance methods

constraint_name

Generate the constraint name

Source
from_column
Source
from_table
Source
name
Source
on_delete
Source
on_update
Source
to_add_sql

Generate ALTER TABLE ADD CONSTRAINT SQL

Source
to_column
Source
to_drop_sql

Generate ALTER TABLE DROP CONSTRAINT SQL

Source
to_inline_sql

Generate inline SQL for CREATE TABLE (CONSTRAINT ... FOREIGN KEY ...)

Source
to_table
Source