Skip to content
New issue

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

Type blob is generated instead of binary Mysql 8.0 #249

Open
RedCatGirl opened this issue Feb 23, 2023 · 3 comments
Open

Type blob is generated instead of binary Mysql 8.0 #249

RedCatGirl opened this issue Feb 23, 2023 · 3 comments
Labels

Comments

@RedCatGirl
Copy link

RedCatGirl commented Feb 23, 2023

The field type binary(16) is converted to the blob type. MySQL 8.0 also has a binary type.

Example

$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
);
@samdark samdark added the type:bug Bug label Feb 23, 2023
@terabytesoftw
Copy link
Member

terabytesoftw commented Feb 23, 2023

Please version Mysql .

@RedCatGirl
Copy link
Author

Please version Mysql .

My version: mysql Ver 8.0.32-0ubuntu0.20.04.2 for Linux on x86_64

@terabytesoftw
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants