Stand-Alone SQL to build database
See original GitHub issue@EdwinVW Would you mind posting a stand-along sql that builds out the database.
This is what I have so far, where some was derived from looking at code that relys on entity.
IF DB_ID('WorkshopManagement') IS NULL CREATE DATABASE WorkshopManagement;
IF DB_ID('CustomerManagement') IS NULL CREATE DATABASE CustomerManagement;
IF DB_ID('VehicleManagement') IS NULL CREATE DATABASE VehicleManagement;
IF DB_ID('WorkshopManagementEventStore') IS NULL CREATE DATABASE WorkshopManagementEventStore;
IF DB_ID('Invoicing') IS NULL CREATE DATABASE Invoicing;
IF DB_ID('Notification') IS NULL CREATE DATABASE Notification;
DROP TABLE IF EXISTS CustomerManagement.dbo.Customer;
if OBJECT_ID('CustomerManagement.dbo.Customer') IS NULL
CREATE TABLE CustomerManagement.dbo.Customer (
[CustomerId] varchar(50) NOT NULL,
[Name] varchar(50) NOT NULL,
[Address] varchar(50) NOT NULL,
[PostalCode] varchar(50) NOT NULL,
[City] varchar(50) NOT NULL,
[TelephoneNumber] varchar(50) NOT NULL,
[EmailAddress] varchar(50) NOT NULL,
PRIMARY KEY([CustomerId]));
DROP TABLE IF EXISTS VehicleManagement.dbo.Vehicle;
if OBJECT_ID('VehicleManagement.dbo.Vehicle') IS NULL
CREATE TABLE VehicleManagement.dbo.Vehicle (
[LicenseNumber] varchar(50) NOT NULL,
[Brand] varchar(50) NOT NULL,
[Type] varchar(50) NOT NULL,
[OwnerId] varchar(50) NOT NULL,
PRIMARY KEY([LicenseNumber]));
DROP TABLE IF EXISTS WorkshopManagementEventStore.dbo.WorkshopPlanningEvent;
DROP TABLE IF EXISTS WorkshopManagementEventStore.dbo.WorkshopPlanning;
if OBJECT_ID('WorkshopManagementEventStore.dbo.WorkshopPlanning') IS NULL
CREATE TABLE WorkshopManagementEventStore.dbo.WorkshopPlanning (
[Id] varchar(50) NOT NULL,
[CurrentVersion] int NOT NULL,
PRIMARY KEY([Id]));
if OBJECT_ID('WorkshopManagementEventStore.dbo.WorkshopPlanningEvent') IS NULL
CREATE TABLE WorkshopManagementEventStore.dbo.WorkshopPlanningEvent (
[Id] varchar(50) NOT NULL REFERENCES WorkshopManagementEventStore.dbo.WorkshopPlanning([Id]),
[Version] int NOT NULL,
[Timestamp] datetime2(7) NOT NULL,
[MessageType] varchar(75) NOT NULL,
[EventData] text,
PRIMARY KEY([Id], [Version]));
DROP TABLE IF EXISTS Invoicing.dbo.Customer;
IF OBJECT_ID('Invoicing.dbo.Customer') IS NULL
CREATE TABLE Invoicing.dbo.Customer (
CustomerId varchar(50) NOT NULL,
Name varchar(50) NOT NULL,
Address varchar(50),
PostalCode varchar(50),
City varchar(50),
PRIMARY KEY(CustomerId));
DROP TABLE IF EXISTS Invoicing.dbo.MaintenanceJob;
IF OBJECT_ID('Invoicing.dbo.MaintenanceJob') IS NULL
CREATE TABLE Invoicing.dbo.MaintenanceJob (
JobId varchar(50) NOT NULL,
LicenseNumber varchar(50) NOT NULL,
CustomerId varchar(50) NOT NULL,
Description varchar(250) NOT NULL,
StartTime datetime2 NULL,
EndTime datetime2 NULL,
Finished bit NOT NULL,
InvoiceSent bit NOT NULL,
PRIMARY KEY(JobId));
DROP TABLE IF EXISTS Invoicing.dbo.Invoice;
IF OBJECT_ID('Invoicing.dbo.Invoice') IS NULL
CREATE TABLE Invoicing.dbo.Invoice (
InvoiceId varchar(50) NOT NULL,
InvoiceDate datetime2 NOT NULL,
CustomerId varchar(50) NOT NULL,
Amount decimal(5,2) NOT NULL,
Specification text,
JobIds varchar(250),
PRIMARY KEY(InvoiceId));
DROP TABLE IF EXISTS Notification.dbo.Customer;
IF OBJECT_ID('Notification.dbo.Customer') IS NULL
CREATE TABLE Notification.dbo.Customer (
CustomerId varchar(50) NOT NULL,
Name varchar(50) NOT NULL,
TelephoneNumber varchar(50),
EmailAddress varchar(50),
PRIMARY KEY(CustomerId));
DROP TABLE IF EXISTS Notification.dbo.MaintenanceJob;
IF OBJECT_ID('Notification.dbo.MaintenanceJob') IS NULL
CREATE TABLE Notification.dbo.MaintenanceJob (
JobId varchar(50) NOT NULL,
LicenseNumber varchar(50) NOT NULL,
CustomerId varchar(50) NOT NULL,
StartTime datetime2 NOT NULL,
Description varchar(250) NOT NULL,
PRIMARY KEY(JobId));
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Creating SQL Server databases in a stand-alone ... - IBM
If you want to use the BPMConfig command to create the stand-alone profile separately from the database tables, you can first run the...
Read more >Create a New Database Project - SQL Server Data Tools (SSDT)
You can create a new database project and import database schema from an existing database, a .sql script file or a Data-tier application ......
Read more >Configure a standalone SQL Server node as database ... - AWS
On the primary FCI, open SQL Server Management Studio (SSMS) and connect to the FCI cluster SQL Server. · Create a new database...
Read more >Installing with database on a stand-alone SQL server
Creating a database on stand-alone SQL Server · Select the SQL Server instance from the drop-down menu or type in the name of...
Read more >Standalone SQL Server Instance Installation using setup
SQL Server Management Studio (SSMS) | Full Course · How to Install & Configure SQL Server 2016 Failover Cluster Step By Step ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, I was working on converting this to grpc. Then it turned into thinking about writing a few of the services in golang. Which then lead me to the dotnetcore entity stuff as the system of record for the tables.
Then it was like: “Hey, this whole thing could be in golang, nats, etc”, which makes the database creation and migration its own thing.
On Sat, Oct 26, 2019 at 6:38 AM Edwin van Wijk notifications@github.com wrote:
@edwinvw in my case i had setup that complete project with dapper as my organisation is not big fan of entity framework(because of performance and other reason) instead we would like to use any micro orm, hence dapper is first choice