forked from yiisoft/yii2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better use int for boolean representation
bit has special syntax for storing and retreiving so we'd need a converter for that. Storing 1 bit will result in one byte left padded on the disc so the result of a query for boolean 0 will be 0x00 and for boolean 1 will be 0x80.
- Loading branch information
Showing
4 changed files
with
6 additions
and
15 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 |
---|---|---|
|
@@ -71,8 +71,8 @@ CREATE TABLE `tbl_type` ( | |
`blob_col` blob, | ||
`numeric_col` decimal(5,2) DEFAULT '33.22', | ||
`time` timestamp NOT NULL DEFAULT '2002-01-01 00:00:00', | ||
`bool_col` bit(1) NOT NULL, | ||
`bool_col2` bit(1) DEFAULT B'1' | ||
`bool_col` smallint NOT NULL, | ||
`bool_col2` smallint DEFAULT 1 | ||
); | ||
|
||
INSERT INTO tbl_customer (email, name, address, status) VALUES ('[email protected]', 'user1', 'address1', 1); | ||
|
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