Deploying model into an empty database

Build master 4940, installed via standard setup.

First I create a new project via wizard - let’s name it IntoTheVoid. Contents of the project directory is following:

drwxr-xr-x 1 omi-w7-64+washi 197121       0 Sep 20 08:56 build/
drwxr-xr-x 1 omi-w7-64+washi 197121       0 Sep 20 08:56 IntoTheVoid/
drwxr-xr-x 1 omi-w7-64+washi 197121       0 Sep 20 08:56 l10n/
drwxr-xr-x 1 omi-w7-64+washi 197121       0 Sep 20 08:56 Root Menu/
drwxr-xr-x 1 omi-w7-64+washi 197121       0 Sep 20 08:56 Root/
drwxr-xr-x 1 omi-w7-64+washi 197121       0 Sep 20 08:56 Security/
-rw-r--r-- 1 omi-w7-64+washi 197121   63383 Sep 17 10:23 Origam Dataspace.xml
-rw-r--r-- 1 omi-w7-64+washi 197121   72957 Sep 17 10:23 Root Menu.xml
-rw-r--r-- 1 omi-w7-64+washi 197121  674696 Sep 17 10:23 Asap Tenant Organization.xml
-rw-r--r-- 1 omi-w7-64+washi 197121  725381 Sep 20 08:56 index.bin
-rw-r--r-- 1 omi-w7-64+washi 197121 1296220 Sep 17 10:23 Security.xml
-rw-r--r-- 1 omi-w7-64+washi 197121 6538189 Sep 17 10:23 Root.xml

I’d argue that the directory build and the XML files in the root of the project directory shouldn’t be there.

Anyway I create a new directory, into which I copy following contents:

drwxr-xr-x 1 omi-w7-64+washi 197121 0 Sep 20 09:03 IntoTheVoid/
drwxr-xr-x 1 omi-w7-64+washi 197121 0 Sep 20 09:03 l10n/
drwxr-xr-x 1 omi-w7-64+washi 197121 0 Sep 20 09:03 Root Menu/
drwxr-xr-x 1 omi-w7-64+washi 197121 0 Sep 20 09:03 Root/
drwxr-xr-x 1 omi-w7-64+washi 197121 0 Sep 20 09:03 Security/

I create a new empty database and declare a new connection in the ORIGAM architect IntoTheVoid-II (via copy of existing connection to the newly created project and adjusting project folder and connection string).

I connect to the IntoTheVoid-II project in the ORIGAM architect and try to open the IntoTheVoid package. Architect shows a dialog - Data database is empty. Do you want to execute initial database scripts? (Since in the FS we’re using only one database wording Data database is empty. doesn’t feel right.)

I confirm that I want to run initial database scripts, error is returned:

========================================
Error while loading package 'IntoTheVoid'
Update failed.
========================================
Update failed.
------------------------------------------
Infinite loop! Copuld not find any deployments without active dependencies.
------------------------------------------
========================================
 Stack trace
========================================
   at Origam.Workbench.Services.DeploymentSorter.SortToRespectDependencies(IEnumerable`1 deplVersionsToSort)
   at Origam.Workbench.Services.DeploymentService.Update()
   at Origam.Workbench.Services.DeploymentService.Deploy()   at Origam.Workbench.Services.DeploymentService.Deploy()
   at OrigamArchitect.frmMain._schema_SchemaLoaded(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at Origam.Workbench.Services.SchemaService.OnSchemaLoaded(EventArgs e)
   at Origam.Workbench.Services.SchemaService.LoadSchema(Guid schemaExtensionId, Guid extraExtensionId, Boolean loadDocumentation, Boolean loadDeploymentScripts)
   at Origam.Workbench.Services.SchemaService.LoadSchema(Guid schemaExtensionId, Boolean loadDocumentation, Boolean loadDeploymentScripts)
   at Origam.Workbench.Commands.LoadSelectedPackage.Run()
   at Origam.Workbench.Pads.ExtensionPad.OpenSelectedPackage()

If I don’t give immediately, I can try to open Root package. I confirm that I want to execute initial database scripts. Then there’s another dialog. Model has been updated and update scripts are pending. Do you want to execute the deployment scripts? I confirm again. Another dialog emerges. Do you want to add active user to the user list? I confirm again. And the Root package is open.

I continue with package Security. Dialog is shown. Model has been updated and update scripts are pending. Do you want to execute the deployment scripts? I confirm. Error is returned:

========================================
Error while loading package 'Security'
Update failed.
========================================
Update failed.
------------------------------------------
Invalid object name 'AsapFeatureList'.
------------------------------------------
========================================
 Stack trace
========================================
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   at Origam.DA.Service.AbstractSqlDataService.ExecuteUpdate(String command, String transactionId)
   at Origam.Workbench.Services.DeploymentService.ExecuteActivity(ServiceCommandUpdateScriptActivity activity)
   at Origam.Workbench.Services.DeploymentService.ExecuteActivity(AbstractUpdateScriptActivity activity)
   at MoreLinq.MoreEnumerable.ForEach[T](IEnumerable`1 source, Action`1 action)
   at Origam.Workbench.Services.DeploymentService.Update()
   at Origam.Workbench.Services.DeploymentService.Deploy()   at Origam.Workbench.Services.DeploymentService.Deploy()
   at OrigamArchitect.frmMain._schema_SchemaLoaded(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at Origam.Workbench.Services.SchemaService.OnSchemaLoaded(EventArgs e)
   at Origam.Workbench.Services.SchemaService.LoadSchema(Guid schemaExtensionId, Guid extraExtensionId, Boolean loadDocumentation, Boolean loadDeploymentScripts)
   at Origam.Workbench.Services.SchemaService.LoadSchema(Guid schemaExtensionId, Boolean loadDocumentation, Boolean loadDeploymentScripts)
   at Origam.Workbench.Commands.LoadSelectedPackage.Run()
   at Origam.Workbench.Pads.ExtensionPad.OpenSelectedPackage()

Deployment scripts of the package Security are referencing old names of the database objects.

I don’t try Root Menu package, since it is referencing Security package.

When I try to open the Root package again. I see a dialog again. Model has been updated and update scripts are pending. Do you want to execute the deployment scripts? I confirm. Package is open. If i try again, the dialog is show again.

Summary:

  • Project folder created by wizard contains folder and files, that, I believe, shouldn’t be there.
  • It is not possible to deploy existing model to the empty database. Mainly because there’s a bug in the ORIGAM architect, but also because not all basic packages have correct deployment scripts.
  • Architect always shows a dialog to run deployment scripts (this is not the case for the IntoTheVoid project that was created via wizard.

Fixed in master build 4972