-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate column type constants (#877)
- Loading branch information
Showing
32 changed files
with
485 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yiisoft\Db\Constant; | ||
|
||
/** | ||
* Defines the available abstract column types. | ||
*/ | ||
final class ColumnType | ||
{ | ||
/** | ||
* Define the abstract column type as `boolean`. | ||
*/ | ||
public const BOOLEAN = 'boolean'; | ||
/** | ||
* Define the abstract column type as `bit`. | ||
*/ | ||
public const BIT = 'bit'; | ||
/** | ||
* Define the abstract column type as `tinyint`. | ||
*/ | ||
public const TINYINT = 'tinyint'; | ||
/** | ||
* Define the abstract column type as `smallint`. | ||
*/ | ||
public const SMALLINT = 'smallint'; | ||
/** | ||
* Define the abstract column type as `integer`. | ||
*/ | ||
public const INTEGER = 'integer'; | ||
/** | ||
* Define the abstract column type as `bigint`. | ||
*/ | ||
public const BIGINT = 'bigint'; | ||
/** | ||
* Define the abstract column type as `float`. | ||
*/ | ||
public const FLOAT = 'float'; | ||
/** | ||
* Define the abstract column type as `double`. | ||
*/ | ||
public const DOUBLE = 'double'; | ||
/** | ||
* Define the abstract column type as `decimal`. | ||
*/ | ||
public const DECIMAL = 'decimal'; | ||
/** | ||
* Define the abstract column type as `money`. | ||
*/ | ||
public const MONEY = 'money'; | ||
/** | ||
* Define the abstract column type as `char`. | ||
*/ | ||
public const CHAR = 'char'; | ||
/** | ||
* Define the abstract column type as `string`. | ||
*/ | ||
public const STRING = 'string'; | ||
/** | ||
* Define the abstract column type as `text`. | ||
*/ | ||
public const TEXT = 'text'; | ||
/** | ||
* Define the abstract column type as `binary`. | ||
*/ | ||
public const BINARY = 'binary'; | ||
/** | ||
* Define the abstract column type as `uuid`. | ||
*/ | ||
public const UUID = 'uuid'; | ||
/** | ||
* Define the abstract column type as `datetime`. | ||
*/ | ||
public const DATETIME = 'datetime'; | ||
/** | ||
* Define the abstract column type as `timestamp`. | ||
*/ | ||
public const TIMESTAMP = 'timestamp'; | ||
/** | ||
* Define the abstract column type as `date`. | ||
*/ | ||
public const DATE = 'date'; | ||
/** | ||
* Define the abstract column type as `time`. | ||
*/ | ||
public const TIME = 'time'; | ||
/** | ||
* Define the abstract column type as `array`. | ||
*/ | ||
public const ARRAY = 'array'; | ||
/** | ||
* Define the abstract column type as `structured`. | ||
*/ | ||
public const STRUCTURED = 'structured'; | ||
/** | ||
* Define the abstract column type as `json`. | ||
*/ | ||
public const JSON = 'json'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yiisoft\Db\Constant; | ||
|
||
/** | ||
* Defines the available column pseudo-types. | ||
* Used to define column primary key types when creating or updating a table schema. | ||
*/ | ||
final class PseudoType | ||
{ | ||
/** | ||
* Define the column pseudo-type a primary key. | ||
*/ | ||
public const PK = 'pk'; | ||
/** | ||
* Define the column pseudo-type as an `unsigned` primary key. | ||
*/ | ||
public const UPK = 'upk'; | ||
/** | ||
* Define the column pseudo-type as a big primary key. | ||
*/ | ||
public const BIGPK = 'bigpk'; | ||
/** | ||
* Define the column pseudo-type as an `unsigned` big primary key. | ||
*/ | ||
public const UBIGPK = 'ubigpk'; | ||
/** | ||
* Define the column pseudo-type as an `uuid` primary key. | ||
*/ | ||
public const UUID_PK = 'uuid_pk'; | ||
/** | ||
* Define the column pseudo-type as an `uuid` primary key with a sequence. | ||
*/ | ||
public const UUID_PK_SEQ = 'uuid_pk_seq'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.