We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The field type binary(16) is converted to the blob type. MySQL 8.0 also has a binary type.
$b->createTable('urls', [ 'id' => $b->bigPrimaryKey()->unsigned(), 'hash' => $b->binary(16)->notNull()->comment('md5 from url')->asString(), // md5 binary 'url' => $b->text()->notNull(), 'create' => $b->timestamp()->notNull()->defaultExpression('CURRENT_TIMESTAMP') ]);
Result:
CREATE TABLE urls ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, hash blob NOT NULL COMMENT 'md5 from url', url text NOT NULL, create timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP );
The text was updated successfully, but these errors were encountered:
Please version Mysql .
Mysql
Sorry, something went wrong.
My version: mysql Ver 8.0.32-0ubuntu0.20.04.2 for Linux on x86_64
https://github.com/yiisoft/yii2/blob/f388ca71b08b89e940f1ffbe4afa19ae9d5e115f/framework/db/mysql/QueryBuilder.php#L45 Here is the mapping to blob, we'll check.
No branches or pull requests
The field type binary(16) is converted to the blob type. MySQL 8.0 also has a binary type.
Example
Result:
The text was updated successfully, but these errors were encountered: