/** * Create/get foreign key schema associated with column and referenced foreign table and column. * Make sure local and outer column types are identical. * * @param string $table Foreign table name. * @param string $column Foreign column name (id by default). * @return AbstractReference * @throws SchemaException */ public function references($table, $column = 'id') { if ($this->phpType() != self::INT) { throw new SchemaException("Only numeric types can be defined with foreign key constraint."); } return $this->table->foreign($this->name)->references($table, $column); }