Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS: Publish-NAVApp not creating tables in SQL #3397

Closed
maze93 opened this issue Aug 20, 2018 · 4 comments
Closed

PS: Publish-NAVApp not creating tables in SQL #3397

maze93 opened this issue Aug 20, 2018 · 4 comments
Labels

Comments

@maze93
Copy link

maze93 commented Aug 20, 2018

Hi all,

I haven't had this problem before. When I try to use the Publish-NAVApp cmdlet the package is deployed and all is good in extension management, however the tables aren't created in the SQL. It works like a charm with CTRL + F5 and the tables are created, however I want to use PS to deploy my projects.

No error messages in either PS or event viewer.

I use this normal cmdlet to publish my package:
image

The first three marked tables have been created with VSCode (CTRL + F5), the last one (missing) should be named -8810.

image

Anybody else with this problem?

@maze93
Copy link
Author

maze93 commented Aug 20, 2018

Hi again!

Update:
It works the first time you publish the project with powershell but not the second. The first time the table doesn't exist so it creates it. The next time I try to add another table to the project and publish with powershell again - then it does not work. However, the table that was published first still exists but the second table is never generated in the SQL.


Another update:
It does work all the time if i change the version number to one higher. It seems this is the solution. Strange that this hasn't occured before. But now I know how to work it, so it should be ok.

@cmrudolph-msft
Copy link

Publish-NavApp never creates tables (by design). That is the job of Sync-NavApp.

Think of it this way:

Publish = compile
Sync = schema alteration
Install = light up the logic

There are reasons for this, most notably the fact that publish is a system-wide concept, while sync (schema) is tied to a tenant database. It is possible to have 3 versions of an extension published to a given service with different versions synced/installed to various tenants. Schema also travels with a tenant when moving across different services, further supporting the need to decouple publish from the rest.

That said, you should familiarize yourself with the sync cmdlet documentation. The difference between sync modes is very important during development. Schema additions must be backwards compatible (more reasons I won't get into here), so invoking the -Mode Clean option is necessary in development if you need to start fresh.

Finally, the F5 VS Code flow wraps all these steps behind a single operation. That operation is not the same as a raw publish in PowerShell.

@maze93
Copy link
Author

maze93 commented Aug 20, 2018

Hi and thank you for your answer @cmrudolph-msft

This may be the problem that I am facing. I have one script with Sync-NAVApp and I have never had a problem with it (I created it to uninstall/reinstall all packages based on their dependencies). I have never had a problem with this script. However this time I used only Publish-NAVApp and then the problem occoured. I was wondering why this has never happened before when I have used the script and that may be the reason. I will try to do it again, this time with Sync-NAVApp and get back with the results.

Thanks!

@maze93
Copy link
Author

maze93 commented Sep 5, 2018

Hi again,

Just wanted to tell you that your solution worked. You may close the issue :)

Thanks!

@maze93 maze93 closed this as completed Sep 5, 2018
@microsoft microsoft locked and limited conversation to collaborators Nov 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants