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

Support binaryuuid out of the box #1732

Closed
dereuromark opened this issue Apr 10, 2020 · 0 comments
Closed

Support binaryuuid out of the box #1732

dereuromark opened this issue Apr 10, 2020 · 0 comments

Comments

@dereuromark
Copy link
Member

dereuromark commented Apr 10, 2020

As per cakephp/migrations#331 (comment)

Currently, this is needed:

$table->addColumn('id', 'binary', [
	'limit' => 16,
	'default' => null,
	'null' => false,
]);

But this should be possible/detected for primary and foreign keys:

    $this->table('uuid16_test_rows', ['id' => false, 'primary_key' => ['id']])
        ->addColumn('id', 'binaryuuid', [
            'default' => null,
            'limit' => null,
            'null' => false,
        ])
        ->addColumn('foreign_key_without_index', 'binaryuuid', [
            'default' => null,
            'limit' => null,
            'null' => true,
        ])
        ->addColumn('foreign_key_with_index', 'binaryuuid', [
            'default' => null,
            'limit' => null,
            'null' => true,
        ])
        ->create();

in sync with uuid.

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

No branches or pull requests

1 participant