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

Creating database #3

Open
adriatic opened this issue Feb 23, 2017 · 2 comments
Open

Creating database #3

adriatic opened this issue Feb 23, 2017 · 2 comments

Comments

@adriatic
Copy link
Member

adriatic commented Feb 23, 2017

Note

This application should be compiled and executed using Visual Studio 2017 (I used the RC version) regardless of the established fact that it behaves the same when using Visual Studio 2015. Its other half (Carmel) cannot be built with Visual Studio 2015.


Introduction

This document explains the (quite convoluted, initially) process that uses the file https://aurelia-ui-toolkits.github.io/aurelia-kendoui-samples/samples.json as the definition of the collection of samples presented by the Aurelia KendoUI Bridge's Catalog application.

@adriatic
Copy link
Member Author

adriatic commented Apr 1, 2017

Step 1: Create the database seed data.

Use Visual Studio Code to run the "Transformer" code, which will use the local copy to generate code file. This file is then manually inserted into section of the CatalogContextSeedData.cs class.

Notes:

  1. The Node "Transformer" application expects the local copy of the samples.json file - instead of fetching the original. I left this detail to @JeroenVinke to do right, once carmel becomes integrated with the catalog application

  2. The process of creating the core file and then having to manually replace the content of the CreateSeedData() method in CatalogContextSeedData could certainly be improved. I created this hack in order to do more important parts of carmel app.

@adriatic
Copy link
Member Author

adriatic commented Apr 1, 2017

Step 2: Create the database itself.

While this setup is quite raw - (lots of manual interventions), it works 😄

Assume that the database already exists, so this description handles any step after the first. Thus the reason for creating the database would be the change in the initial Carmel models content.

Step 2.1

Delete the database CarmelDb:

image

Note that this action takes place locally, using Visual Studio 2015 Update 3, leaving the task of uploading the database to (Azure) host to a separate process. In order to avoid issues with Database Migrations, I decided to always create the whole database from scratch.

Step 2.2

Edit the "Transformer" Javascript app to accommodate for the Carmel models changes. This is easiest done by opening the local copy of the node folder with Visual Studio Code.

Step 2.3

After verifying the correct generation of the generated C# code, run the command node main,js > code1, which results with the new version of the code file.

Step 2.4

Insert the content of this local code file into local copy of the DbInitializer.cs file replacing this section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant