struct

Ralph::Schema::DatabaseForeignKey

Inherits Struct / Value / Object

Represents a foreign key constraint

Constructors

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

Instance methods

clone
Source
copy_with(name _name = @name, from_table _from_table = @from_table, from_column _from_column = @from_column, to_table _to_table = @to_table, to_column _to_column = @to_column, on_delete _on_delete = @on_delete, on_update _on_update = @on_update)
Source
from_column

Source column (the FK column)

from_table

Source table (the table with the FK column)

name

Constraint name (may be nil for SQLite)

on_delete

ON DELETE action (:cascade, :set_null, :restrict, :no_action)

on_update

ON UPDATE action

to_column

Target column (usually the primary key)

to_table

Target table (the referenced table)