-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support creating indexes on table with schema
When creating an index on a table where the schema is specified, the schema shouldn't be included in the index name.
- Loading branch information
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { expect } from 'chai'; | ||
import * as Indexes from '../lib/operations/indexes'; | ||
|
||
describe('lib/operations/indexes', () => { | ||
describe('.create', () => { | ||
it('check schema not included in index name', () => { | ||
const sql = Indexes.create({ schema: 'a', name: 'b' }, ['c', 'd']); | ||
expect(sql).to.equal('CREATE INDEX "b_c_d_index" ON "a"."b" ("c", "d");'); | ||
}); | ||
}); | ||
}); |