PS: Publish-NAVApp not creating tables in SQL
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:

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

Anybody else with this problem?
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.
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.
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!
Hi again,
Just wanted to tell you that your solution worked. You may close the issue :)
Thanks!