Skip to content

Commit

Permalink
Fix: Updated algorithm typo (fixes #1601)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeleventhal committed Dec 20, 2023
1 parent 0a4e3b2 commit 157f609
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions drizzle-orm/src/mysql-core/indexes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ interface IndexConfig {
using?: 'btree' | 'hash';

/**
* If set, the index will be created as `create index ... algorythm { 'default' | 'inplace' | 'copy' }`.
* If set, the index will be created as `create index ... algorithm { 'default' | 'inplace' | 'copy' }`.
*/
algorythm?: 'default' | 'inplace' | 'copy';
algorithm?: 'default' | 'inplace' | 'copy';

/**
* If set, adds locks to the index creation.
Expand Down Expand Up @@ -67,8 +67,8 @@ export class IndexBuilder implements AnyIndexBuilder {
return this;
}

algorythm(algorythm: IndexConfig['algorythm']): this {
this.config.algorythm = algorythm;
algorithm(algorithm: IndexConfig['algorithm']): this {
this.config.algorithm = algorithm;
return this;
}

Expand Down
2 changes: 1 addition & 1 deletion drizzle-orm/type-tests/mysql/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const users = mysqlTable(
uniqueClass: uniqueIndex('uniqueClass')
.on(users.class, users.subClass)
.lock('default')
.algorythm('copy')
.algorithm('copy')
.using(`btree`),
legalAge: check('legalAge', sql`${users.age1} > 18`),
usersClassFK: foreignKey({ columns: [users.subClass], foreignColumns: [classes.subClass] }),
Expand Down

0 comments on commit 157f609

Please sign in to comment.