You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create the model, repository, and detasource with @property({type: 'string', mysql: {index: {kind: "FULLTEXT"}}}) on model.
npm run migrate on cli.
It should make FULLTEXT INDEX, however it isn't made on MySQL.
This is example of a model.
// Copyright IBM Corp. and LoopBack contributors 2018,2020. All Rights Reserved.// Node module: @loopback/example-todo// This file is licensed under the MIT License.// License text available at https://opensource.org/licenses/MITimport{Entity,model,property}from'@loopback/repository';
@model()exportclassTodoextendsEntity{
@property({type: 'number',id: true,generated: false,})id?: number;
@property({type: 'string',required: true,// Not work for index creationmysql: {index: {kind: 'FULLTEXT',},},})title: string;
@property({type: 'string',// work for index creation. but it is diffrent by READMEindex: {kind: 'FULLTEXT',// also it can `unique: true` in here, not mysql.index.unique...},})desc?: string;constructor(data?: Partial<Todo>){super(data);}}exportinterfaceTodoRelations{// describe navigational properties here}exporttypeTodoWithRelations=Todo&TodoRelations;
Current Behavior
@property.mysql.index is not work.
But, I see work with @property.index.
Expected Behavior
We can replace @property.mysql.index with @property.index on README.
Steps to reproduce
@property({type: 'string', mysql: {index: {kind: "FULLTEXT"}}})
on model.npm run migrate
on cli.This is example of a model.
Current Behavior
@property.mysql.index
is not work.But, I see work with
@property.index
.Expected Behavior
We can replace
@property.mysql.index
with@property.index
on README.loopback-connector-mysql/README.md
Lines 535 to 545 in f8f40a1
Or,
Fix the
prop.index
toprop.mysql.index
andm.properties[propName].index;
tom.properties[propName].mysql.index;
on migration.js.loopback-connector-mysql/lib/migration.js
Line 661 in f8f40a1
loopback-connector-mysql/lib/migration.js
Line 361 in f8f40a1
Link to reproduction sandbox
https://github.com/forno/loopback-next/blob/index-bug-report/examples/todo/src/models/todo.model.ts
Additional information
the index creation function are already exist. But it is different config written by README.
I don't know that either is correct.
Related Issues
#350
See Reporting Issues for more tips on writing good issues
The text was updated successfully, but these errors were encountered: