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

Commit

Permalink
fix(pull): script computed field formula
Browse files Browse the repository at this point in the history
Closes #30
  • Loading branch information
justinlettau committed Jul 7, 2018
1 parent 80fb9d7 commit 2092150
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/sql/record-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface ColumnRecordSet {
is_identity: boolean;
seed_value: number;
increment_value: number;
formula: string;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/sql/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ function column(item: ColumnRecordSet): string {
let output: string = `[${item.name}]`;

if (item.is_computed) {
output += ` as ${item.definition}`;
output += ` as ${item.formula}`;
return output;
}

output += ` ${item.datatype}`;
Expand Down
3 changes: 2 additions & 1 deletion src/sql/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const columnRead: string = `
dc.definition,
ic.is_identity,
ic.seed_value,
ic.increment_value
ic.increment_value,
cc.definition as formula
from
sys.columns c
join sys.types tp on c.user_type_id = tp.user_type_id
Expand Down

0 comments on commit 2092150

Please sign in to comment.