Skip to content

Commit

Permalink
chore(pull): fix the idempotency method for table-valued parameters
Browse files Browse the repository at this point in the history
The idempotency method was not scripting out properly when the object type is
`TT` when the option is `if-not-exists`. This commit fixes that.

fixes justinlettau#22
  • Loading branch information
David Guilherme committed Apr 3, 2018
1 parent 807b939 commit 3e861e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sql/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function idempotency(item: AbstractRecordSet, type: IdempotencyOption): s
// if not exists
if (item.type === 'TT') {
return [
'if exists (',
'if not exists (',
' select * from sys.table_types as t',
' join sys.schemas s on t.schema_id = s.schema_id',
` where t.name = '${item.name}' and s.name = '${item.schema}'`,
Expand Down

0 comments on commit 3e861e5

Please sign in to comment.