<p></p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nrdvana/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nrdvana">@nrdvana</a> - yes, no problem at all. I think this patch would give you the foundation to implement <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1507242489" data-permission-text="Title is private" data-url="https://github.com/dbsrgits/sql-translator/issues/154" data-hovercard-type="issue" data-hovercard-url="/dbsrgits/sql-translator/issues/154/hovercard" href="https://github.com/dbsrgits/sql-translator/issues/154">#154</a>. It enables fields to be specified as hashrefs (with properties) rather than just a simple scalar name. This particular patch then adds only one property, which is <code class="notranslate">prefix_length</code>, but all the hard work is done so you could probably add other properties (I have just pushed another commit now that should enable that to happen, so that MySQL will ignore the option if it's not <code class="notranslate">prefix_length</code>).</p>
<p dir="auto">In changelog style:</p>
<ul dir="auto">
<li>Enable index lengths to be specified for each indexed field in MySQL</li>
</ul>
<p dir="auto">As an example:</p>
<p dir="auto"><code class="notranslate">$sqlt_table-&gt;add_index(name =&gt; 'user_idx_value', fields =&gt; [ { name =&gt; 'value', prefix_length =&gt; 64 } ]);</code></p>
<p dir="auto">So you could add another property, e.g.</p>
<p dir="auto"><code class="notranslate">$sqlt_table-&gt;add_index(name =&gt; 'user_idx_t', fields =&gt; [ { name =&gt; 't', opclass =&gt; 'gin_trgm_ops' } ]);</code></p>
<p dir="auto">Take a look at this for example code which you could add to the PostgreSQL producer: <a href="https://github.com/abeverley/sql-translator/blob/d064562a9ff1f0f227a6bcd0ec8c6242454d6d61/lib/SQL/Translator/Producer/MySQL.pm#L688">https://github.com/abeverley/sql-translator/blob/d064562a9ff1f0f227a6bcd0ec8c6242454d6d61/lib/SQL/Translator/Producer/MySQL.pm#L688</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />Reply to this email directly, <a href="https://github.com/dbsrgits/sql-translator/pull/68#issuecomment-1596619839">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AACJ4AWDTF5HWD6EWMEGL4LXL72MZANCNFSM4BOZ5HZA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AACJ4ATYXMOASCIGXOREHTDXL72MZA5CNFSM4BOZ5HZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOL4VHYPY.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span>&lt;dbsrgits/sql-translator/pull/68/c1596619839</span><span>@</span><span>github</span><span>.</span><span>com&gt;</span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/dbsrgits/sql-translator/pull/68#issuecomment-1596619839",
"url": "https://github.com/dbsrgits/sql-translator/pull/68#issuecomment-1596619839",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>