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

The table-valued parameters are not being created #22

Closed
davidguilherme opened this issue Apr 2, 2018 · 0 comments · Fixed by #23
Closed

The table-valued parameters are not being created #22

davidguilherme opened this issue Apr 2, 2018 · 0 comments · Fixed by #23
Labels

Comments

@davidguilherme
Copy link
Contributor

Type

What kind of issue is this?

[x] Bug report.
[ ] Feature request.

Current Behavior

The table-valued parameters are not being created when the idempotency option for table-valued parameters is if-not-exists even though they are not already created.

Expected behavior

The command push should create the table-valued parameters when the idempotency option for this is if-not-exists and they are not already created.

Steps to Reproduce

  1. Sets the idempotency option for table-valued parameter to if-not-exists.
  2. Pull any database with table-valued parameters;
  3. Push the scripts to an empty database;
  4. Checks if there is the table-valued parameter in there.

Other Information

I believe this problem is related to this line: https://github.com/justinlettau/sql-source-control/blob/master/src/sql/script.ts#L76

I can open a Pull Request for this.

davidguilherme pushed a commit to davidguilherme/sql-source-control that referenced this issue Apr 3, 2018
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
justinlettau pushed a commit that referenced this issue Apr 4, 2018
* chore(pull): fix the idempotency method for table-valued parameters

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 #22

* chore(pull): do not script comma out after the tvp's last column

The comma after the last column is not allowed. It raises a syntax
error. Exception: `Incorrect syntax near ')'. `
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants