InsertForeignKey class Null safety

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
read-only, override
foreignKeyColumn String
Defaults to lowercase ${foreignTableName}_brick_id
final
foreignTableName String
final
forGenerator String
Outputs model as String to be used in a generator
read-only, override
hashCode int
The hash code for this object. [...]
read-only, inherited
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.
read-only, inherited
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
read-only, override

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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 [...]