-
Notifications
You must be signed in to change notification settings - Fork 6
Home
We used an official MS LightSwitch sample application in order to show how your legacy application can be migrated to CUBA Platform. This project contains a CUBA application, which:
- replicates the UI and business logic of the original MS Lightswitch application
- uses its database
- has been produced with the help of the CUBA Studio migration tool
The migration tool doesn't change the structure of existing tables, so CUBA and LS applications will have the ability to work simultaneously, using the same instance of the database.
##LightSwitch Application
You can find the development guide for the Vision Clinic sample and create it yourself or simply download it.
The Vision Clinic example stores data in two different databases, linking data between them. In order to simplify the example, we merge the two databases into one and create a foreign key between Product
and InvoiceDetails
tables, so the DB schema looks as follows:
In fact, for our purposes we don’t need the whole Lightswitch application, it is sufficient to have only its database. You can find instructions on how to create it in the Database section.
To make your application up and running on MS SQL Server:
- Download and install MS SQL Server 2012+ from the official website.
- Run create-db.sql script; then run insert-data.sql script; finally apply the create-cuba-related-tables.sql script to create all CUBA-related tables and data.
- Enable SQL Server and Windows Authentication mode and
sa
user to login as it is shown here. Remember password for thesa
, it will be used for connecting the database from our CUBA application.
Follow the steps below to run the application:
- Download and install the latest version of the CUBA Studio.
- Download or clone the project to your local PC.
- Run the CUBA Studio server and open it in a browser (default URL is http://localhost:8111/studio/).
- Import the project by selecting its folder.
- By default, the application uses in-memory relational database management system HSQL, so you already can start the application and the Studio will create a new empty database. You can navigate through the application, create products, invoices and so on. Proceed to the next step to see how it works with the original database of our legacy application.
- Follow the instructions in the Database section.
- Specify connection parameters to the database in project properties (note that if you use SQLEXPRESS or named instance you should specify your instance name in Connection Params, e.g.
;instance=SQLEXPRESS
). - Press test connection and if shows success, invoke Run -> Start Application Server from the menu.