InsertForeignKey class

Create a foreign key column to reference another table

Inheritance

Constructors

InsertForeignKey(String localTableName, String foreignTableName, {String? foreignKeyColumn, bool onDeleteCascade = false, bool onDeleteSetDefault = false})
const

Properties

down MigrationCommand
Outputs the opposite command to be used in a generator
no setteroverride
foreignKeyColumn String
Defaults to lowercase ${foreignTableName}_brick_id
final
foreignTableName String
final
forGenerator String
Outputs model as String to be used in a generator
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
localTableName String
final
onDeleteCascade bool
When true, deletion of the referenced record by foreignKeyColumn on the foreignTableName this record. For example, if the foreign table is "departments" and the local table is "employees," whenever that department is deleted, "employee" will be deleted. Defaults false.
final
onDeleteSetDefault bool
When true, deletion of a parent will set this table's referencing column to the default, usually NULL unless otherwise declared. Defaults false.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statement String
When the last foreign key column is created on a joins table, an index is created to ensure that duplicate entries are not inserted
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Alias for statement
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

foreignKeyColumnName(String foreignTableName, [String? prefix]) String
Generate a column that references another table.
joinsTableForeignColumnName(String foreignTableName) String
In the rare case of a many-to-many association of the same model, the columns must be prefixed. For example, final List<Friend> friends on class Friend.
joinsTableLocalColumnName(String localTableName) String
In the rare case of a many-to-many association of the same model, the columns must be prefixed. For example, final List<Friend> friends on class Friend.
joinsTableName(String columnName, {required String localTableName}) String
Compose the name for a joins table between two associations, for example