0 フォロワー

クラス yii\db\oci\ColumnSchemaBuilder

継承yii\db\oci\ColumnSchemaBuilder » yii\db\ColumnSchemaBuilder » yii\base\BaseObject
実装yii\base\Configurable
利用可能なバージョン2.0.6
ソースコード https://github.com/yiisoft/yii2/blob/master/framework/db/oci/ColumnSchemaBuilder.php

ColumnSchemaBuilder は、Oracle データベース用のスキーマビルダーです。

公開プロパティ

継承されたプロパティを非表示

プロパティ 説明 定義元
$after string この列が追加される列の後。 yii\db\ColumnSchemaBuilder
$append mixed 列スキーマ定義に追加される SQL 文字列。 yii\db\ColumnSchemaBuilder
$categoryMap array 抽象列タイプ(キー)からタイプカテゴリ(値)へのマッピング。 yii\db\ColumnSchemaBuilder
$check string 列の CHECK 制約。 yii\db\ColumnSchemaBuilder
$comment string 列のコメント値。 yii\db\ColumnSchemaBuilder
$db yii\db\Connection 現在のデータベース接続。 yii\db\ColumnSchemaBuilder
$default mixed 列のデフォルト値。 yii\db\ColumnSchemaBuilder
$isFirst boolean この列をテーブルの先頭に挿入するかどうか。 yii\db\ColumnSchemaBuilder
$isNotNull boolean|null 列が NULL 可能かどうか。 yii\db\ColumnSchemaBuilder
$isUnique boolean 列の値が一意である必要があるかどうか。 yii\db\ColumnSchemaBuilder
$isUnsigned boolean 列の値が符号なしである必要があるかどうか。 yii\db\ColumnSchemaBuilder
$length integer|string|array 列のサイズまたは精度定義。 yii\db\ColumnSchemaBuilder
$type string INTEGER、VARCHAR、DATETIME などの列タイプ定義。 yii\db\ColumnSchemaBuilder
$typeCategoryMap array 抽象列タイプ(キー)からタイプカテゴリ(値)へのマッピング。 yii\db\ColumnSchemaBuilder

保護されたプロパティ

継承されたプロパティを非表示

プロパティ 説明 定義元

公開メソッド

継承されたメソッドを非表示

メソッド 説明 定義元
__call() クラスメソッドではない名前付きメソッドを呼び出します。 yii\base\BaseObject
__construct() タイプと値の精度を指定して、列スキーマビルダーのインスタンスを作成します。 yii\db\ColumnSchemaBuilder
__get() オブジェクトプロパティの値を返します。 yii\base\BaseObject
__isset() プロパティが設定されているかどうか、つまり定義されており null ではないかどうかを確認します。 yii\base\BaseObject
__set() オブジェクトプロパティの値を設定します。 yii\base\BaseObject
__toString() 列のスキーマの完全な文字列を構築します。 yii\db\oci\ColumnSchemaBuilder
__unset() オブジェクトプロパティを null に設定します。 yii\base\BaseObject
after() 列に AFTER 制約を追加します。 yii\db\ColumnSchemaBuilder
append() 列定義に追加する追加の SQL を指定します。 yii\db\ColumnSchemaBuilder
canGetProperty() プロパティが読み取り可能かどうかを示す値を返します。 yii\base\BaseObject
canSetProperty() プロパティが設定可能かどうかを示す値を返します。 yii\base\BaseObject
check() 列の CHECK 制約を設定します。 yii\db\ColumnSchemaBuilder
className() このクラスの完全修飾名を返します。 yii\base\BaseObject
comment() 列のコメントを指定します。 yii\db\ColumnSchemaBuilder
defaultExpression() 列のデフォルトの SQL 式を指定します。 yii\db\ColumnSchemaBuilder
defaultValue() 列のデフォルト値を指定します。 yii\db\ColumnSchemaBuilder
first() 列に FIRST 制約を追加します。 yii\db\ColumnSchemaBuilder
getCategoryMap() yii\db\ColumnSchemaBuilder
hasMethod() メソッドが定義されているかどうかを示す値を返します。 yii\base\BaseObject
hasProperty() プロパティが定義されているかどうかを示す値を返します。 yii\base\BaseObject
init() オブジェクトを初期化します。 yii\base\BaseObject
notNull() 列に NOT NULL 制約を追加します。 yii\db\ColumnSchemaBuilder
null() 列に NULL 制約を追加します。 yii\db\ColumnSchemaBuilder
setCategoryMap() yii\db\ColumnSchemaBuilder
unique() 列に UNIQUE 制約を追加します。 yii\db\ColumnSchemaBuilder
unsigned() 列を符号なしとしてマークします。 yii\db\ColumnSchemaBuilder

保護されたメソッド

継承されたメソッドを非表示

メソッド 説明 定義元
buildAfterString() 列の後の制約を構築します。デフォルトはサポートされていません。 yii\db\ColumnSchemaBuilder
buildAppendString() 列定義に追加されるカスタム文字列を構築します。 yii\db\ColumnSchemaBuilder
buildCheckString() 列のチェック制約を構築します。 yii\db\ColumnSchemaBuilder
buildCommentString() 列のコメント仕様を構築します。 yii\db\ColumnSchemaBuilder
buildCompleteString() 入力形式から完全な列定義を返します。 yii\db\ColumnSchemaBuilder
buildDefaultString() 列のデフォルト値の仕様を構築します。 yii\db\ColumnSchemaBuilder
buildDefaultValue() 列のデフォルト値を返します。 yii\db\ColumnSchemaBuilder
buildFirstString() 列の最初の制約を構築します。デフォルトはサポートされていません。 yii\db\ColumnSchemaBuilder
buildLengthString() 列の長さ/精度部分を構築します。 yii\db\ColumnSchemaBuilder
buildNotNullString() 列の NOT NULL 制約を構築します。 yii\db\ColumnSchemaBuilder
buildUniqueString() 列の一意制約を構築します。 yii\db\ColumnSchemaBuilder
buildUnsignedString() 列の符号なし文字列を構築します。デフォルトはサポートされていません。 yii\db\oci\ColumnSchemaBuilder
getTypeCategory() 列タイプのカテゴリを返します。 yii\db\ColumnSchemaBuilder

定数

継承された定数を非表示

定数 説明 定義元
CATEGORY_NUMERIC 'numeric' yii\db\ColumnSchemaBuilder
CATEGORY_OTHER 'other' yii\db\ColumnSchemaBuilder
CATEGORY_PK 'pk' yii\db\ColumnSchemaBuilder
CATEGORY_STRING 'string' yii\db\ColumnSchemaBuilder
CATEGORY_TIME 'time' yii\db\ColumnSchemaBuilder

メソッドの詳細

継承されたメソッドを非表示

__call() public メソッド

定義元: yii\base\BaseObject::__call()

クラスメソッドではない名前付きメソッドを呼び出します。

不明なメソッドが呼び出されたときに暗黙的に呼び出される PHP マジックメソッドであるため、このメソッドを直接呼び出さないでください。

public mixed __call ( $name, $params )
$name string

メソッド名

$params array

メソッドのパラメータ

return mixed

メソッドの戻り値

throws yii\base\UnknownMethodException

不明なメソッドを呼び出すとき

                public function __call($name, $params)
{
    throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::$name()");
}

            
__construct() public メソッド

定義元: yii\db\ColumnSchemaBuilder::__construct()

タイプと値の精度を指定して、列スキーマビルダーのインスタンスを作成します。

public void __construct ( $type, $length null, $db null, $config = [] )
$type string

カラムの型。$type を参照してください。

$length integer|string|array|null

カラムの長さまたは精度。$length を参照してください。

$db yii\db\Connection|null

現在のデータベース接続。$db を参照してください。

$config array

オブジェクトのプロパティを初期化するために使用される名前と値のペア

                public function __construct($type, $length = null, $db = null, $config = [])
{
    $this->type = $type;
    $this->length = $length;
    $this->db = $db;
    parent::__construct($config);
}

            
__get() public メソッド

定義元: yii\base\BaseObject::__get()

オブジェクトプロパティの値を返します。

$value = $object->property; の実行時に暗黙的に呼び出されるPHPのマジックメソッドであるため、このメソッドを直接呼び出さないでください。

__set() も参照してください。

public mixed __get ( $name )
$name string

プロパティ名

return mixed

プロパティの値

throws yii\base\UnknownPropertyException

プロパティが定義されていない場合

throws yii\base\InvalidCallException

プロパティが書き込み専用の場合

                public function __get($name)
{
    $getter = 'get' . $name;
    if (method_exists($this, $getter)) {
        return $this->$getter();
    } elseif (method_exists($this, 'set' . $name)) {
        throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
    }
    throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
}

            
__isset() public メソッド

定義元: yii\base\BaseObject::__isset()

プロパティが設定されているかどうか、つまり定義されており null ではないかどうかを確認します。

isset($object->property) の実行時に暗黙的に呼び出されるPHPのマジックメソッドであるため、このメソッドを直接呼び出さないでください。

プロパティが定義されていない場合、falseが返されることに注意してください。

https://www.php.net/manual/en/function.isset.php も参照してください。

public boolean __isset ( $name )
$name string

プロパティ名またはイベント名

return boolean

指定されたプロパティが設定されているかどうか (nullでないかどうか)。

                public function __isset($name)
{
    $getter = 'get' . $name;
    if (method_exists($this, $getter)) {
        return $this->$getter() !== null;
    }
    return false;
}

            
__set() public メソッド

定義元: yii\base\BaseObject::__set()

オブジェクトプロパティの値を設定します。

$object->property = $value; の実行時に暗黙的に呼び出されるPHPのマジックメソッドであるため、このメソッドを直接呼び出さないでください。

__get() も参照してください。

public void __set ( $name, $value )
$name string

プロパティ名またはイベント名

$value mixed

プロパティの値

throws yii\base\UnknownPropertyException

プロパティが定義されていない場合

throws yii\base\InvalidCallException

プロパティが読み取り専用の場合

                public function __set($name, $value)
{
    $setter = 'set' . $name;
    if (method_exists($this, $setter)) {
        $this->$setter($value);
    } elseif (method_exists($this, 'get' . $name)) {
        throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
    } else {
        throw new UnknownPropertyException('Setting unknown property: ' . get_class($this) . '::' . $name);
    }
}

            
__toString() public メソッド

列のスキーマの完全な文字列を構築します。

public string __toString ( )

                public function __toString()
{
    switch ($this->getTypeCategory()) {
        case self::CATEGORY_PK:
            $format = '{type}{length}{check}{append}';
            break;
        case self::CATEGORY_NUMERIC:
            $format = '{type}{length}{unsigned}{default}{notnull}{check}{append}';
            break;
        default:
            $format = '{type}{length}{default}{notnull}{check}{append}';
    }
    return $this->buildCompleteString($format);
}

            
__unset() public メソッド

定義元: yii\base\BaseObject::__unset()

オブジェクトプロパティを null に設定します。

unset($object->property) の実行時に暗黙的に呼び出されるPHPのマジックメソッドであるため、このメソッドを直接呼び出さないでください。

プロパティが定義されていない場合、このメソッドは何もしません。プロパティが読み取り専用の場合、例外がスローされます。

https://www.php.net/manual/en/function.unset.php も参照してください。

public void __unset ( $name )
$name string

プロパティ名

throws yii\base\InvalidCallException

プロパティが読み取り専用の場合。

                public function __unset($name)
{
    $setter = 'set' . $name;
    if (method_exists($this, $setter)) {
        $this->$setter(null);
    } elseif (method_exists($this, 'get' . $name)) {
        throw new InvalidCallException('Unsetting read-only property: ' . get_class($this) . '::' . $name);
    }
}

            
after() public メソッド (バージョン 2.0.8 以降で利用可能)

定義元: yii\db\ColumnSchemaBuilder::after()

列に AFTER 制約を追加します。

注意: MySQL、Oracle、Cubridのみがサポートします。

public $this after ( $after )
$after string

このカラムが追加されるカラムの後ろの指定。

                public function after($after)
{
    $this->after = $after;
    return $this;
}

            
append() public メソッド (バージョン 2.0.9 以降で利用可能)

定義元: yii\db\ColumnSchemaBuilder::append()

列定義に追加する追加の SQL を指定します。

位置修飾子は、それらをサポートするデータベースのカラム定義の後に追加されます。

public $this append ( $sql )
$sql string

追加されるSQL文字列。

                public function append($sql)
{
    $this->append = $sql;
    return $this;
}

            
buildAfterString() protected メソッド (バージョン 2.0.8 以降で利用可能)

定義元: yii\db\ColumnSchemaBuilder::buildAfterString()

列の後の制約を構築します。デフォルトはサポートされていません。

protected string buildAfterString ( )
return string

AFTER制約を含む文字列。

                protected function buildAfterString()
{
    return '';
}

            
buildAppendString() protected メソッド (バージョン 2.0.9 以降で利用可能)

定義元: yii\db\ColumnSchemaBuilder::buildAppendString()

列定義に追加されるカスタム文字列を構築します。

protected string buildAppendString ( )
return string

追加するカスタム文字列。

                protected function buildAppendString()
{
    return $this->append !== null ? ' ' . $this->append : '';
}

            
buildCheckString() protected メソッド

定義元: yii\db\ColumnSchemaBuilder::buildCheckString()

列のチェック制約を構築します。

protected string buildCheckString ( )
return string

CHECK制約を含む文字列。

                protected function buildCheckString()
{
    return $this->check !== null ? " CHECK ({$this->check})" : '';
}

            
buildCommentString() protected メソッド (バージョン 2.0.8 から利用可能)

定義元: yii\db\ColumnSchemaBuilder::buildCommentString()

列のコメント仕様を構築します。

protected string buildCommentString ( )
return string

COMMENTキーワードとコメント自体を含む文字列。

                protected function buildCommentString()
{
    return '';
}

            
buildCompleteString() protected メソッド (バージョン 2.0.8 から利用可能)

定義元: yii\db\ColumnSchemaBuilder::buildCompleteString()

入力形式から完全な列定義を返します。

protected string buildCompleteString ( $format )
$format string

定義のフォーマット。

return string

完全なカラム定義を含む文字列。

                protected function buildCompleteString($format)
{
    $placeholderValues = [
        '{type}' => $this->type,
        '{length}' => $this->buildLengthString(),
        '{unsigned}' => $this->buildUnsignedString(),
        '{notnull}' => $this->buildNotNullString(),
        '{unique}' => $this->buildUniqueString(),
        '{default}' => $this->buildDefaultString(),
        '{check}' => $this->buildCheckString(),
        '{comment}' => $this->buildCommentString(),
        '{pos}' => $this->isFirst ? $this->buildFirstString() : $this->buildAfterString(),
        '{append}' => $this->buildAppendString(),
    ];
    return strtr($format, $placeholderValues);
}

            
buildDefaultString() protected メソッド

定義元: yii\db\ColumnSchemaBuilder::buildDefaultString()

列のデフォルト値の仕様を構築します。

protected string buildDefaultString ( )
return string

カラムのデフォルト値を持つ文字列。

                protected function buildDefaultString()
{
    $defaultValue = $this->buildDefaultValue();
    if ($defaultValue === null) {
        return '';
    }
    return ' DEFAULT ' . $defaultValue;
}

            
buildDefaultValue() protected メソッド

定義元: yii\db\ColumnSchemaBuilder::buildDefaultValue()

列のデフォルト値を返します。

protected string|null buildDefaultValue ( )
return string|null

カラムのデフォルト値を持つ文字列。

                protected function buildDefaultValue()
{
    if ($this->default === null) {
        return $this->isNotNull === false ? 'NULL' : null;
    }
    switch (gettype($this->default)) {
        case 'double':
            // ensure type cast always has . as decimal separator in all locales
            $defaultValue = StringHelper::floatToString($this->default);
            break;
        case 'boolean':
            $defaultValue = $this->default ? 'TRUE' : 'FALSE';
            break;
        case 'integer':
        case 'object':
            $defaultValue = (string) $this->default;
            break;
        default:
            $defaultValue = "'{$this->default}'";
    }
    return $defaultValue;
}

            
buildFirstString() protected メソッド (バージョン 2.0.8 から利用可能)

定義元: yii\db\ColumnSchemaBuilder::buildFirstString()

列の最初の制約を構築します。デフォルトはサポートされていません。

protected string buildFirstString ( )
return string

FIRST制約を含む文字列。

                protected function buildFirstString()
{
    return '';
}

            
buildLengthString() protected メソッド

定義元: yii\db\ColumnSchemaBuilder::buildLengthString()

列の長さ/精度部分を構築します。

protected string buildLengthString ( )

                protected function buildLengthString()
{
    if ($this->length === null || $this->length === []) {
        return '';
    }
    if (is_array($this->length)) {
        $this->length = implode(',', $this->length);
    }
    return "({$this->length})";
}

            
buildNotNullString() protected メソッド

定義元: yii\db\ColumnSchemaBuilder::buildNotNullString()

列の NOT NULL 制約を構築します。

protected string buildNotNullString ( )
return string

$isNotNull が true の場合は 'NOT NULL' を、$isNotNull が false の場合は 'NULL' を、それ以外の場合は空文字列を返します。

                protected function buildNotNullString()
{
    if ($this->isNotNull === true) {
        return ' NOT NULL';
    } elseif ($this->isNotNull === false) {
        return ' NULL';
    }
    return '';
}

            
buildUniqueString() protected メソッド

定義元: yii\db\ColumnSchemaBuilder::buildUniqueString()

列の一意制約を構築します。

protected string buildUniqueString ( )
return string

$isUnique が true の場合は 'UNIQUE' という文字列を返し、それ以外の場合は空文字列を返します。

                protected function buildUniqueString()
{
    return $this->isUnique ? ' UNIQUE' : '';
}

            
buildUnsignedString() protected メソッド (バージョン 2.0.7 から利用可能)

列の符号なし文字列を構築します。デフォルトはサポートされていません。

protected string buildUnsignedString ( )
return string

UNSIGNEDキーワードを含む文字列。

                protected function buildUnsignedString()
{
    return $this->isUnsigned ? ' UNSIGNED' : '';
}

            
canGetProperty() public メソッド

定義元: yii\base\BaseObject::canGetProperty()

プロパティが読み取り可能かどうかを示す値を返します。

プロパティが読み取り可能になるのは、

  • クラスが指定された名前に関連付けられたゲッターメソッドを持つ場合(この場合、プロパティ名は大小文字を区別しません)。
  • クラスが指定された名前のメンバー変数を持つ場合 ($checkVars が true の場合)。

canSetProperty()も参照してください。

public boolean canGetProperty ( $name, $checkVars true )
$name string

プロパティ名

$checkVars boolean

メンバー変数をプロパティとして扱うかどうか。

return boolean

プロパティが読み取り可能かどうか。

                public function canGetProperty($name, $checkVars = true)
{
    return method_exists($this, 'get' . $name) || $checkVars && property_exists($this, $name);
}

            
canSetProperty() public メソッド

定義元: yii\base\BaseObject::canSetProperty()

プロパティが設定可能かどうかを示す値を返します。

プロパティが書き込み可能になるのは、

  • クラスが指定された名前に関連付けられたセッターメソッドを持つ場合(この場合、プロパティ名は大小文字を区別しません)。
  • クラスが指定された名前のメンバー変数を持つ場合 ($checkVars が true の場合)。

canGetProperty()も参照してください。

public boolean canSetProperty ( $name, $checkVars true )
$name string

プロパティ名

$checkVars boolean

メンバー変数をプロパティとして扱うかどうか。

return boolean

プロパティが書き込み可能かどうか。

                public function canSetProperty($name, $checkVars = true)
{
    return method_exists($this, 'set' . $name) || $checkVars && property_exists($this, $name);
}

            
check() public メソッド

定義場所: yii\db\ColumnSchemaBuilder::check()

列の CHECK 制約を設定します。

public $this check ( $check )
$check string

追加されるCHECK制約のSQL。

                public function check($check)
{
    $this->check = $check;
    return $this;
}

            
className() public static メソッド
2.0.14から非推奨。PHP >=5.5では::classを使用してください。

定義場所: yii\base\BaseObject::className()

このクラスの完全修飾名を返します。

public static string className ( )
return string

このクラスの完全修飾名。

                public static function className()
{
    return get_called_class();
}

            
comment() public メソッド (バージョン2.0.8から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::comment()

列のコメントを指定します。

public $this comment ( $comment )
$comment string

コメント

                public function comment($comment)
{
    $this->comment = $comment;
    return $this;
}

            
defaultExpression() public メソッド (バージョン2.0.7から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::defaultExpression()

列のデフォルトの SQL 式を指定します。

public $this defaultExpression ( $default )
$default string

デフォルト値の式。

                public function defaultExpression($default)
{
    $this->default = new Expression($default);
    return $this;
}

            
defaultValue() public メソッド

定義場所: yii\db\ColumnSchemaBuilder::defaultValue()

列のデフォルト値を指定します。

public $this defaultValue ( $default )
$default mixed

デフォルト値。

                public function defaultValue($default)
{
    if ($default === null) {
        $this->null();
    }
    $this->default = $default;
    return $this;
}

            
first() public メソッド (バージョン2.0.8から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::first()

列に FIRST 制約を追加します。

注意: MySQL、Oracle、Cubridのみがサポートします。

public $this first ( )

                public function first()
{
    $this->isFirst = true;
    return $this;
}

            
getCategoryMap() public メソッド (バージョン2.0.43から利用可能)
public array getCategoryMap ( )
return array

抽象列タイプ(キー)からタイプカテゴリ(値)へのマッピング。

                public function getCategoryMap()
{
    return static::$typeCategoryMap;
}

            
getTypeCategory() protected メソッド (バージョン2.0.8から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::getTypeCategory()

列タイプのカテゴリを返します。

protected string getTypeCategory ( )
return string

カラム型のカテゴリ名を含む文字列。

                protected function getTypeCategory()
{
    return isset($this->categoryMap[$this->type]) ? $this->categoryMap[$this->type] : null;
}

            
hasMethod() public メソッド

定義場所: yii\base\BaseObject::hasMethod()

メソッドが定義されているかどうかを示す値を返します。

デフォルトの実装はPHP関数method_exists()の呼び出しです。PHPのマジックメソッド__call()を実装した場合は、このメソッドをオーバーライドできます。

public boolean hasMethod ( $name )
$name string

メソッド名

return boolean

メソッドが定義されているかどうか

                public function hasMethod($name)
{
    return method_exists($this, $name);
}

            
hasProperty() public メソッド

定義場所: yii\base\BaseObject::hasProperty()

プロパティが定義されているかどうかを示す値を返します。

プロパティは以下の場合に定義されます。

  • クラスに指定された名前に関連付けられたゲッターまたはセッターメソッドがある場合(この場合、プロパティ名は大小文字を区別しません)。
  • クラスが指定された名前のメンバー変数を持つ場合 ($checkVars が true の場合)。

参照

public boolean hasProperty ( $name, $checkVars true )
$name string

プロパティ名

$checkVars boolean

メンバー変数をプロパティとして扱うかどうか。

return boolean

プロパティが定義されているかどうか

                public function hasProperty($name, $checkVars = true)
{
    return $this->canGetProperty($name, $checkVars) || $this->canSetProperty($name, false);
}

            
init() public メソッド

定義場所: yii\base\BaseObject::init()

オブジェクトを初期化します。

このメソッドは、オブジェクトが与えられた構成で初期化された後、コンストラクタの最後に呼び出されます。

public void init ( )

                public function init()
{
}

            
notNull() public メソッド

定義場所: yii\db\ColumnSchemaBuilder::notNull()

列に NOT NULL 制約を追加します。

public $this notNull ( )

                public function notNull()
{
    $this->isNotNull = true;
    return $this;
}

            
null() public メソッド (バージョン2.0.9から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::null()

列に NULL 制約を追加します。

public $this null ( )

                public function null()
{
    $this->isNotNull = false;
    return $this;
}

            
setCategoryMap() public メソッド (バージョン2.0.43から利用可能)
public void setCategoryMap ( $categoryMap )
$categoryMap array

抽象列タイプ(キー)からタイプカテゴリ(値)へのマッピング。

                public function setCategoryMap($categoryMap)
{
    static::$typeCategoryMap = $categoryMap;
}

            
unique() public メソッド

定義元: yii\db\ColumnSchemaBuilder::unique()

列に UNIQUE 制約を追加します。

public $this unique ( )

                public function unique()
{
    $this->isUnique = true;
    return $this;
}

            
unsigned() public メソッド (バージョン 2.0.7 から利用可能)

定義元: yii\db\ColumnSchemaBuilder::unsigned()

列を符号なしとしてマークします。

public $this unsigned ( )

                public function unsigned()
{
    switch ($this->type) {
        case Schema::TYPE_PK:
            $this->type = Schema::TYPE_UPK;
            break;
        case Schema::TYPE_BIGPK:
            $this->type = Schema::TYPE_UBIGPK;
            break;
    }
    $this->isUnsigned = true;
    return $this;
}