Sitelet https://github.com/lorenzo/cakephp-email-queue/pull/36
Skip to content

Added: alter template column so it can accept longer template path - #36

Merged
lorenzo merged 3 commits into
lorenzo:masterfrom
noglitchyo:master
Aug 14, 2019
Merged

lorenzo merged 3 commits into
lorenzo:masterfrom
noglitchyo:master

Conversation

@noglitchyo

Copy link
Copy Markdown
Contributor

Length of the column template is restricted to 50 chars. This is actually too short and will make email with a longer template path failed to be enqueued.
It is often that a template path for an email go beyond that limit. For example, while using the plugin syntax in the template.

{
$this->table('email_queue')
->changeColumn('template', 'string', [
'limit' => 255,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the actual longest template name that you have?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lorenzo For example: Passbolt/MultiFactorAuthentication.LU/mfa_user_settings_reset
It is 61 chars long, but potentially, it could be longer.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make it 100, otherwise it is not indexable by mysql, in case we need to index it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. With utf8mb4 collation, it would indeed fail.
"100" seems enough for a template path, and we still have room for more if needed (can go up until 191).

Should we throw an exception if larger or do we let the driver handle it?

@lorenzo lorenzo Aug 14, 2019 •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds like a good idea (using an exception)

@noglitchyo noglitchyo Aug 14, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its done, added doc in README as well

@lorenzo

lorenzo commented Aug 14, 2019

Copy link
Copy Markdown
Owner

Thanks!

@lorenzo
lorenzo merged commit e298e33 into lorenzo:master Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants