Class yii\db\mssql\ColumnSchemaBuilder
Inheritance | yii\db\mssql\ColumnSchemaBuilder » yii\db\ColumnSchemaBuilder » yii\base\BaseObject |
---|---|
Implements | yii\base\Configurable |
Available since version | 2.0.42 |
Source Code | https://github.com/yiisoft/yii2/blob/master/framework/db/mssql/ColumnSchemaBuilder.php |
ColumnSchemaBuilder is the schema builder for MSSQL databases.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$categoryMap | array | Mapping of abstract column types (keys) to type categories (values). | yii\db\ColumnSchemaBuilder |
$checkValue | string|null | The CHECK constraint for the column. |
yii\db\mssql\ColumnSchemaBuilder |
$comment | string | Comment value of the column. | yii\db\ColumnSchemaBuilder |
$db | yii\db\Connection | The current database connection. | yii\db\ColumnSchemaBuilder |
$defaultValue | string|yii\db\Expression|null | Default value of the column. | yii\db\mssql\ColumnSchemaBuilder |
$typeCategoryMap | array | Mapping of abstract column types (keys) to type categories (values). | yii\db\ColumnSchemaBuilder |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$after | string | The column after which this column will be added. | yii\db\ColumnSchemaBuilder |
$append | mixed | SQL string to be appended to column schema definition. | yii\db\ColumnSchemaBuilder |
$check | string | The CHECK constraint for the column. |
yii\db\ColumnSchemaBuilder |
$default | mixed | Default value of the column. | yii\db\ColumnSchemaBuilder |
$format | yii\db\mssql\ColumnSchemaBuilder | ||
$isFirst | boolean | Whether this column is to be inserted at the beginning of the table. | yii\db\ColumnSchemaBuilder |
$isNotNull | boolean|null | Whether the column is or not nullable. | yii\db\ColumnSchemaBuilder |
$isUnique | boolean | Whether the column values should be unique. | yii\db\ColumnSchemaBuilder |
$isUnsigned | boolean | Whether the column values should be unsigned. | yii\db\ColumnSchemaBuilder |
$length | integer|string|array | Column size or precision definition. | yii\db\ColumnSchemaBuilder |
$type | string | The column type definition such as INTEGER, VARCHAR, DATETIME, etc. | yii\db\ColumnSchemaBuilder |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\BaseObject |
__construct() | Create a column schema builder instance giving the type and value precision. | yii\db\ColumnSchemaBuilder |
__get() | Returns the value of an object property. | yii\base\BaseObject |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\BaseObject |
__set() | Sets value of an object property. | yii\base\BaseObject |
__toString() | Builds the full string for the column's schema. | yii\db\mssql\ColumnSchemaBuilder |
__unset() | Sets an object property to null. | yii\base\BaseObject |
after() | Adds an AFTER constraint to the column. |
yii\db\ColumnSchemaBuilder |
append() | Specify additional SQL to be appended to column definition. | yii\db\ColumnSchemaBuilder |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\BaseObject |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\BaseObject |
check() | Sets a CHECK constraint for the column. |
yii\db\ColumnSchemaBuilder |
className() | Returns the fully qualified name of this class. | yii\base\BaseObject |
comment() | Specifies the comment for column. | yii\db\ColumnSchemaBuilder |
defaultExpression() | Specify the default SQL expression for the column. | yii\db\ColumnSchemaBuilder |
defaultValue() | Specify the default value for the column. | yii\db\ColumnSchemaBuilder |
first() | Adds an FIRST constraint to the column. |
yii\db\ColumnSchemaBuilder |
getCategoryMap() | yii\db\ColumnSchemaBuilder | |
getCheckValue() | Get the Check value for constraint |
yii\db\mssql\ColumnSchemaBuilder |
getDefaultValue() | Getting the Default value for constraint |
yii\db\mssql\ColumnSchemaBuilder |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\BaseObject |
hasProperty() | Returns a value indicating whether a property is defined. | yii\base\BaseObject |
init() | Initializes the object. | yii\base\BaseObject |
isUnique() | yii\db\mssql\ColumnSchemaBuilder | |
notNull() | Adds a NOT NULL constraint to the column. |
yii\db\ColumnSchemaBuilder |
null() | Adds a NULL constraint to the column. |
yii\db\ColumnSchemaBuilder |
setAlterColumnFormat() | Changes default format string to MSSQL ALTER COMMAND. | yii\db\mssql\ColumnSchemaBuilder |
setCategoryMap() | yii\db\ColumnSchemaBuilder | |
unique() | Adds a UNIQUE constraint to the column. |
yii\db\ColumnSchemaBuilder |
unsigned() | Marks column as unsigned. | yii\db\ColumnSchemaBuilder |
Protected Methods
Method | Description | Defined By |
---|---|---|
buildAfterString() | Builds the after constraint for the column. Defaults to unsupported. | yii\db\ColumnSchemaBuilder |
buildAppendString() | Builds the custom string that's appended to column definition. | yii\db\ColumnSchemaBuilder |
buildCheckString() | Builds the check constraint for the column. | yii\db\ColumnSchemaBuilder |
buildCommentString() | Builds the comment specification for the column. | yii\db\ColumnSchemaBuilder |
buildCompleteString() | Returns the complete column definition from input format. | yii\db\ColumnSchemaBuilder |
buildDefaultString() | Builds the default value specification for the column. | yii\db\ColumnSchemaBuilder |
buildDefaultValue() | Return the default value for the column. | yii\db\ColumnSchemaBuilder |
buildFirstString() | Builds the first constraint for the column. Defaults to unsupported. | yii\db\ColumnSchemaBuilder |
buildLengthString() | Builds the length/precision part of the column. | yii\db\ColumnSchemaBuilder |
buildNotNullString() | Builds the not null constraint for the column. | yii\db\ColumnSchemaBuilder |
buildUniqueString() | Builds the unique constraint for the column. | yii\db\ColumnSchemaBuilder |
buildUnsignedString() | Builds the unsigned string for column. Defaults to unsupported. | yii\db\ColumnSchemaBuilder |
getTypeCategory() | Returns the category of the column type. | yii\db\ColumnSchemaBuilder |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
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 |
Property Details
The CHECK
constraint for the column.
Default value of the column.
Method Details
Builds the full string for the column's schema.
public string __toString ( ) |
Get the Check
value for constraint
public string|null getCheckValue ( ) | ||
return | string|null | The |
---|
Getting the Default
value for constraint
public string|yii\db\Expression|null getDefaultValue ( ) | ||
return | string|yii\db\Expression|null | Default value of the column. |
---|
public boolean isUnique ( ) | ||
return | boolean | Whether the column values should be unique. If this is |
---|
Changes default format string to MSSQL ALTER COMMAND.
public void setAlterColumnFormat ( ) |