Repository: sequelize/sequelize
File: test/unit/sql/index.test.js (JavaScript)

Code before:
        });
      });
      it('operator in multiple fields #2', () => {
        expectsql(sql.addIndexQuery('table', {
          fields: [{
            name: 'path',
            operator: 'text_pattern_ops',
          }, 'level', {
            name: 'name',
            operator: 'varchar_pattern_ops',
          }],
          using: 'btree',
        }), {
          postgres: 'CREATE INDEX "table_path_level_name" ON "table" USING btree ("path" text_pattern_ops, "level", "name" varchar_pattern_ops)',
        });
      });
    }

    if (current.dialect.supports.index.include) {
      it('INCLUDE', () => {
        expectsql(sql.addIndexQuery('User',  {
          name: 'email_include_name',
          fields: ['email'],
          include: ['first_name', 'last_name'],
        }), {
          mssql: 'CREATE INDEX [email_include_name] ON [User] ([email]) INCLUDE ([first_name], [last_name])',
        });
      });
    }
  });

  describe('removeIndex', () => {
    it('naming', () => {
      expectsql(sql.removeIndexQuery('table', ['column1', 'column2'], {}, 'table'), {
        ibmi: 'BEGIN IF EXISTS (SELECT * FROM QSYS2.SYSINDEXES WHERE INDEX_NAME = \'table_column1_column2\') THEN DROP INDEX "table_column1_column2"; COMMIT; END IF; END',
        mariadb: 'DROP INDEX `table_column1_column2` ON `table`',
        mysql: 'DROP INDEX `table_column1_column2` ON `table`',
        mssql: 'DROP INDEX [table_column1_column2] ON [table]',
        db2: 'DROP INDEX "table_column1_column2"',
        default: 'DROP INDEX IF EXISTS [table_column1_column2]',
      });
    });
  });
});


Review comment (suggestion):
```suggestion
          default: 'CREATE INDEX [email_include_name] ON [User] ([email]) INCLUDE ([first_name], [last_name])',
```

Code after:
            operator: 'varchar_pattern_ops',
          }],
          using: 'btree',
        }), {
          postgres: 'CREATE INDEX "table_path_level_name" ON "table" USING btree ("path" text_pattern_ops, "level", "name" varchar_pattern_ops)',
        });
      });
    }

    it('include columns with unique index', () => {
      expectsql(() => sql.addIndexQuery('User',  {
        name: 'email_include_name',
        fields: ['email'],
        include: ['first_name', 'last_name'],
        unique: true,
      }), {
        default: new Error(`The include attribute for indexes is not supported by ${current.dialect.name} dialect`),
        mssql: 'CREATE UNIQUE INDEX [email_include_name] ON [User] ([email]) INCLUDE ([first_name], [last_name])',
        'db2 postgres': 'CREATE UNIQUE INDEX "email_include_name" ON "User" ("email") INCLUDE ("first_name", "last_name")',
      });
    });

    it('include columns with non-unique index', () => {
      expectsql(() => sql.addIndexQuery('User',  {
        name: 'email_include_name',
        fields: ['email'],
        include: ['first_name', 'last_name'],
      }), {
        db2: new Error('DB2 does not support non-unique indexes with INCLUDE syntax.'),
        default: new Error(`The include attribute for indexes is not supported by ${current.dialect.name} dialect`),
        mssql: 'CREATE INDEX [email_include_name] ON [User] ([email]) INCLUDE ([first_name], [last_name])',
        postgres: 'CREATE INDEX "email_include_name" ON "User" ("email") INCLUDE ("first_name", "last_name")',
      });
    });

    it('include columns using a liternal with non-unique index', () => {
      expectsql(() => sql.addIndexQuery('User',  {
        name: 'email_include_name',
        fields: ['email'],
        include: literal('(first_name, last_name)'),
      }), {
        db2: new Error('DB2 does not support non-unique indexes with INCLUDE syntax.'),
        default: new Error(`The include attribute for indexes is not supported by ${current.dialect.name} dialect`),
        mssql: 'CREATE INDEX [email_include_name] ON [User] ([email]) INCLUDE (first_name, last_name)',
        postgres: 'CREATE INDEX "email_include_name" ON "User" ("email") INCLUDE (first_name, last_name)',
      });
    });

    it('include columns using an array of liternals with non-unique index', () => {
      expectsql(() => sql.addIndexQuery('User',  {
        name: 'email_include_name',