Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
fix: script indent inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlettau committed Apr 4, 2018
1 parent f73bbb3 commit 68b20da
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/sql/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export function idempotency(item: AbstractRecordSet, type: IdempotencyOption): s
if (item.type === 'TT') {
return [
'if 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}'`,
' 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}'`,
')',
`drop type [${objectId}]`,
'go',
Expand All @@ -74,9 +74,9 @@ export function idempotency(item: AbstractRecordSet, type: IdempotencyOption): s
if (item.type === 'TT') {
return [
'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}'`,
' 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}'`,
')',
''
].join(EOL);
Expand Down Expand Up @@ -132,19 +132,19 @@ export function table(

// columns
for (const col of columns.filter(x => x.object_id === item.object_id)) {
output += ' ' + column(col) + ',';
output += ' ' + column(col) + ',';
output += EOL;
}

// primary keys
for (const pk of primaryKeys.filter(x => x.object_id === item.object_id)) {
output += ' ' + primaryKey(pk);
output += ' ' + primaryKey(pk);
output += EOL;
}

// foreign keys
for (const fk of foreignKeys.filter(x => x.object_id === item.object_id)) {
output += ' ' + foreignKey(fk);
output += ' ' + foreignKey(fk);
output += EOL;
}

Expand Down Expand Up @@ -180,7 +180,7 @@ export function tvp(
columns
.filter(x => x.object_id === item.object_id)
.forEach((col, idx, array) => {
output += ' ' + column(col);
output += ' ' + column(col);

// if it is not the last column
if (idx !== array.length - 1) {
Expand Down

0 comments on commit 68b20da

Please sign in to comment.