visualbasic/migration #1
110
.vscode/tasks.json
vendored
110
.vscode/tasks.json
vendored
@ -18,6 +18,116 @@
|
||||
"panel": "new"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "docker-build",
|
||||
"type": "shell",
|
||||
"command": "wsl",
|
||||
"args": [
|
||||
"docker",
|
||||
"build",
|
||||
"-t",
|
||||
"st-database",
|
||||
"./ef-migration/infrastructure/sql-server"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "shared"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "docker-run",
|
||||
"type": "shell",
|
||||
"command": "wsl",
|
||||
"args": [
|
||||
"docker",
|
||||
"run",
|
||||
"-d",
|
||||
"-p",
|
||||
"1433:1433",
|
||||
"--name",
|
||||
"st-db",
|
||||
"st-database"
|
||||
],
|
||||
"group": "none",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "shared"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "docker-stop",
|
||||
"type": "shell",
|
||||
"command": "wsl",
|
||||
"args": [
|
||||
"docker",
|
||||
"stop",
|
||||
"st-db"
|
||||
],
|
||||
"group": "none",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "shared"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "docker-remove",
|
||||
"type": "shell",
|
||||
"command": "wsl",
|
||||
"args": [
|
||||
"docker",
|
||||
"rm",
|
||||
"st-db"
|
||||
],
|
||||
"group": "none",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "shared"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "docker-logs",
|
||||
"type": "shell",
|
||||
"command": "wsl",
|
||||
"args": [
|
||||
"docker",
|
||||
"logs",
|
||||
"st-db"
|
||||
],
|
||||
"group": "none",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "shared"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "docker-status",
|
||||
"type": "shell",
|
||||
"command": "wsl",
|
||||
"args": [
|
||||
"docker",
|
||||
"ps",
|
||||
"-a",
|
||||
"--filter",
|
||||
"name=st-db",
|
||||
"--format",
|
||||
"\"{{.Names}} - {{.Status}}\""
|
||||
],
|
||||
"group": "none",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "shared"
|
||||
},
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
74
ef-migration/Docker/install-docker.ps1
Normal file
74
ef-migration/Docker/install-docker.ps1
Normal file
@ -0,0 +1,74 @@
|
||||
# Requires -RunAsAdministrator
|
||||
|
||||
function Write-Status($Message, $Type = "Info") {
|
||||
switch ($Type) {
|
||||
"Info" { $Color = "White" }
|
||||
"Success" { $Color = "Green" }
|
||||
"Error" { $Color = "Red" }
|
||||
"Warning" { $Color = "Yellow" }
|
||||
}
|
||||
Write-Host ">>> $Message" -ForegroundColor $Color
|
||||
}
|
||||
|
||||
# Check if running as Administrator
|
||||
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
|
||||
if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||
Write-Status "This script must be run as Administrator" "Error"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
try {
|
||||
# Install Windows features required for Docker
|
||||
Write-Status "Installing required Windows features..." "Info"
|
||||
Enable-WindowsOptionalFeature -Online -FeatureName containers -All -NoRestart
|
||||
|
||||
# Download Docker Engine
|
||||
Write-Status "Downloading Docker Engine..." "Info"
|
||||
$dockerUrl = "https://download.docker.com/win/static/stable/x86_64/docker-24.0.7.zip"
|
||||
$dockerZip = "$env:TEMP\docker.zip"
|
||||
$dockerPath = "C:\Program Files\Docker"
|
||||
|
||||
Invoke-WebRequest -Uri $dockerUrl -OutFile $dockerZip
|
||||
|
||||
# Extract Docker Engine
|
||||
Write-Status "Extracting Docker Engine..." "Info"
|
||||
Expand-Archive -Path $dockerZip -DestinationPath $env:ProgramFiles -Force
|
||||
Remove-Item $dockerZip -Force
|
||||
|
||||
# Add Docker to PATH
|
||||
Write-Status "Adding Docker to PATH..." "Info"
|
||||
$oldPath = [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)
|
||||
if (-not $oldPath.Contains($dockerPath)) {
|
||||
$newPath = "$oldPath;$dockerPath"
|
||||
[Environment]::SetEnvironmentVariable("Path", $newPath, [EnvironmentVariableTarget]::Machine)
|
||||
}
|
||||
|
||||
# Create Docker service
|
||||
Write-Status "Creating Docker service..." "Info"
|
||||
& "$dockerPath\dockerd.exe" --register-service
|
||||
|
||||
# Start Docker service
|
||||
Write-Status "Starting Docker service..." "Info"
|
||||
Start-Service docker
|
||||
|
||||
# Test Docker installation
|
||||
Write-Status "Testing Docker installation..." "Info"
|
||||
docker version
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Status "Docker Engine installed successfully!" "Success"
|
||||
} else {
|
||||
Write-Status "Docker installation completed but service test failed" "Warning"
|
||||
}
|
||||
|
||||
# Pull SQL Server image
|
||||
Write-Status "Pulling SQL Server image..." "Info"
|
||||
docker pull mcr.microsoft.com/mssql/server:2022-latest
|
||||
|
||||
Write-Status "`nDocker Engine installation completed!" "Success"
|
||||
Write-Status "You can now use Docker commands directly." "Info"
|
||||
Write-Status "Please restart your computer to ensure all changes take effect." "Warning"
|
||||
|
||||
} catch {
|
||||
Write-Status "An error occurred: $_" "Error"
|
||||
Exit 1
|
||||
}
|
||||
126
ef-migration/Docker/uninstall-docker.ps1
Normal file
126
ef-migration/Docker/uninstall-docker.ps1
Normal file
@ -0,0 +1,126 @@
|
||||
# Requires -RunAsAdministrator
|
||||
|
||||
function Write-Status($Message, $Type = "Info") {
|
||||
switch ($Type) {
|
||||
"Info" { $Color = "White" }
|
||||
"Success" { $Color = "Green" }
|
||||
"Error" { $Color = "Red" }
|
||||
"Warning" { $Color = "Yellow" }
|
||||
}
|
||||
Write-Host ">>> $Message" -ForegroundColor $Color
|
||||
}
|
||||
|
||||
# Check if running as Administrator
|
||||
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
|
||||
if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||
Write-Status "This script must be run as Administrator" "Error"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
try {
|
||||
# Stop Docker containers
|
||||
Write-Status "Stopping Docker containers..." "Info"
|
||||
$containers = docker ps -aq
|
||||
if ($containers) {
|
||||
docker stop $containers
|
||||
Write-Status "All containers stopped" "Success"
|
||||
} else {
|
||||
Write-Status "No running containers found" "Info"
|
||||
}
|
||||
|
||||
# Remove Docker containers
|
||||
Write-Status "Removing Docker containers..." "Info"
|
||||
$containers = docker ps -aq
|
||||
if ($containers) {
|
||||
docker rm $containers
|
||||
Write-Status "All containers removed" "Success"
|
||||
} else {
|
||||
Write-Status "No containers to remove" "Info"
|
||||
}
|
||||
|
||||
# Remove Docker images
|
||||
Write-Status "Removing Docker images..." "Info"
|
||||
$images = docker images -aq
|
||||
if ($images) {
|
||||
docker rmi -f $images
|
||||
Write-Status "All images removed" "Success"
|
||||
} else {
|
||||
Write-Status "No images to remove" "Info"
|
||||
}
|
||||
|
||||
# Stop Docker service
|
||||
Write-Status "Stopping Docker service..." "Info"
|
||||
$dockerService = Get-Service -Name "com.docker.service" -ErrorAction SilentlyContinue
|
||||
if ($dockerService) {
|
||||
Stop-Service "com.docker.service" -Force
|
||||
Write-Status "Docker service stopped" "Success"
|
||||
} else {
|
||||
Write-Status "Docker service not found" "Info"
|
||||
}
|
||||
|
||||
# Remove Docker Desktop
|
||||
Write-Status "Uninstalling Docker Desktop..." "Info"
|
||||
$dockerDesktop = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "*Docker Desktop*" }
|
||||
if ($dockerDesktop) {
|
||||
$dockerDesktop.Uninstall()
|
||||
Write-Status "Docker Desktop uninstalled" "Success"
|
||||
} else {
|
||||
Write-Status "Docker Desktop not found in installed programs" "Info"
|
||||
}
|
||||
|
||||
# Clean up Docker data directories
|
||||
$directories = @(
|
||||
"$env:ProgramData\Docker",
|
||||
"$env:APPDATA\Docker",
|
||||
"$env:LOCALAPPDATA\Docker"
|
||||
)
|
||||
|
||||
foreach ($dir in $directories) {
|
||||
if (Test-Path $dir) {
|
||||
Write-Status "Removing $dir..." "Info"
|
||||
Remove-Item -Path $dir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Write-Status "$dir removed" "Success"
|
||||
}
|
||||
}
|
||||
|
||||
# Remove environment variables
|
||||
Write-Status "Cleaning up environment variables..." "Info"
|
||||
$dockerEnvVars = @(
|
||||
'DOCKER_HOST',
|
||||
'DOCKER_TLS_VERIFY',
|
||||
'DOCKER_CERT_PATH',
|
||||
'DOCKER_CONFIG',
|
||||
'DOCKER_CONTEXT'
|
||||
)
|
||||
|
||||
foreach ($var in $dockerEnvVars) {
|
||||
if (Test-Path env:$var) {
|
||||
Remove-Item env:$var -ErrorAction SilentlyContinue
|
||||
[System.Environment]::SetEnvironmentVariable($var, $null, 'User')
|
||||
[System.Environment]::SetEnvironmentVariable($var, $null, 'Machine')
|
||||
Write-Status "Removed environment variable: $var" "Success"
|
||||
}
|
||||
}
|
||||
|
||||
# Clean up registry entries
|
||||
Write-Status "Cleaning up registry entries..." "Info"
|
||||
$registryPaths = @(
|
||||
'HKCU:\Software\Docker Inc.',
|
||||
'HKLM:\Software\Docker Inc.'
|
||||
)
|
||||
|
||||
foreach ($path in $registryPaths) {
|
||||
if (Test-Path $path) {
|
||||
Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Write-Status "Removed registry path: $path" "Success"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Status "Docker uninstallation completed successfully!" "Success"
|
||||
Write-Status "Please restart your computer to complete the cleanup." "Warning"
|
||||
|
||||
} catch {
|
||||
Write-Status "An error occurred during uninstallation: $_" "Error"
|
||||
Write-Status "Please try to finish the cleanup manually" "Warning"
|
||||
Exit 1
|
||||
}
|
||||
81
ef-migration/infrastructure/Build-Containers.ps1
Normal file
81
ef-migration/infrastructure/Build-Containers.ps1
Normal file
@ -0,0 +1,81 @@
|
||||
# Build-Containers.ps1
|
||||
param (
|
||||
[switch]$Force
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
function Test-WSLRequirements {
|
||||
Write-Host "Checking WSL requirements..." -ForegroundColor Yellow
|
||||
|
||||
# Check if WSL is installed
|
||||
$wslInstalled = Get-Command wsl.exe -ErrorAction SilentlyContinue
|
||||
if (-not $wslInstalled) {
|
||||
Write-Host "WSL is not installed. Please run the following commands as Administrator:" -ForegroundColor Red
|
||||
Write-Host "wsl --install" -ForegroundColor Yellow
|
||||
Write-Host "Then restart your computer and run:" -ForegroundColor Yellow
|
||||
Write-Host "wsl --install -d Ubuntu" -ForegroundColor Yellow
|
||||
return $false
|
||||
}
|
||||
|
||||
# Check if any distribution is installed
|
||||
$wslDistros = wsl --list
|
||||
if ($LASTEXITCODE -ne 0 -or $wslDistros -match "no installed distributions") {
|
||||
Write-Host "No WSL distribution found. Please run the following command as Administrator:" -ForegroundColor Red
|
||||
Write-Host "wsl --install -d Ubuntu" -ForegroundColor Yellow
|
||||
return $false
|
||||
}
|
||||
|
||||
# Check if Docker Desktop is running
|
||||
$dockerPs = Get-Process "Docker Desktop" -ErrorAction SilentlyContinue
|
||||
if (-not $dockerPs) {
|
||||
Write-Host "Docker Desktop is not running. Please start Docker Desktop and try again." -ForegroundColor Red
|
||||
return $false
|
||||
}
|
||||
|
||||
Write-Host "WSL requirements checked successfully!" -ForegroundColor Green
|
||||
return $true
|
||||
}
|
||||
|
||||
# Check WSL requirements
|
||||
if (-not (Test-WSLRequirements)) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Starting Docker build process..." -ForegroundColor Green
|
||||
|
||||
# Define container names
|
||||
$containerName = "st-db"
|
||||
$imageName = "st-database"
|
||||
|
||||
# Get the current script directory
|
||||
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$sqlServerPath = Join-Path $scriptPath "sql-server"
|
||||
|
||||
# Verify Dockerfile exists
|
||||
if (-not (Test-Path (Join-Path $sqlServerPath "Dockerfile"))) {
|
||||
Write-Host "Dockerfile not found in $sqlServerPath" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
try {
|
||||
# Change to the SQL Server directory
|
||||
Push-Location $sqlServerPath
|
||||
|
||||
# Build the Docker image
|
||||
Write-Host "Building Docker image '$imageName'..." -ForegroundColor Yellow
|
||||
docker build -t $imageName .
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "Docker image built successfully!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed to build Docker image" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
} catch {
|
||||
Write-Host "An error occurred: $_" -ForegroundColor Red
|
||||
exit 1
|
||||
} finally {
|
||||
# Return to original directory
|
||||
Pop-Location
|
||||
}
|
||||
89
ef-migration/infrastructure/Manage-Containers.ps1
Normal file
89
ef-migration/infrastructure/Manage-Containers.ps1
Normal file
@ -0,0 +1,89 @@
|
||||
# Manage-Containers.ps1
|
||||
param (
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ValidateSet('run', 'stop', 'remove')]
|
||||
[string]$Action,
|
||||
[switch]$Force
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Define container names
|
||||
$containerName = "st-db"
|
||||
$imageName = "st-database"
|
||||
|
||||
function Start-Container {
|
||||
Write-Host "Starting container '$containerName'..." -ForegroundColor Yellow
|
||||
|
||||
# Check if container exists and is stopped
|
||||
$existingContainer = docker ps -a --filter "name=$containerName" --format "{{.Names}}"
|
||||
if ($existingContainer) {
|
||||
Write-Host "Container already exists, starting it..." -ForegroundColor Yellow
|
||||
docker start $containerName
|
||||
} else {
|
||||
# Run new container
|
||||
Write-Host "Creating and starting new container..." -ForegroundColor Yellow
|
||||
docker run -d -p 1433:1433 --name $containerName $imageName
|
||||
}
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "Container started successfully!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed to start container" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
function Stop-Container {
|
||||
Write-Host "Stopping container '$containerName'..." -ForegroundColor Yellow
|
||||
|
||||
# Check if container exists and is running
|
||||
$runningContainer = docker ps --filter "name=$containerName" --format "{{.Names}}"
|
||||
if ($runningContainer) {
|
||||
docker stop $containerName
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "Container stopped successfully!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed to stop container" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
} else {
|
||||
Write-Host "Container is not running" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
function Remove-Container {
|
||||
Write-Host "Removing container '$containerName'..." -ForegroundColor Yellow
|
||||
|
||||
# Stop container if running
|
||||
$runningContainer = docker ps --filter "name=$containerName" --format "{{.Names}}"
|
||||
if ($runningContainer) {
|
||||
Write-Host "Stopping container first..." -ForegroundColor Yellow
|
||||
docker stop $containerName
|
||||
}
|
||||
|
||||
# Remove container
|
||||
$existingContainer = docker ps -a --filter "name=$containerName" --format "{{.Names}}"
|
||||
if ($existingContainer) {
|
||||
docker rm $containerName
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "Container removed successfully!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed to remove container" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
} else {
|
||||
Write-Host "Container does not exist" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
switch ($Action) {
|
||||
'run' { Start-Container }
|
||||
'stop' { Stop-Container }
|
||||
'remove' { Remove-Container }
|
||||
}
|
||||
} catch {
|
||||
Write-Host "An error occurred: $_" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
26
ef-migration/infrastructure/sql-server/Dockerfile
Normal file
26
ef-migration/infrastructure/sql-server/Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
# Use the lightweight SQL Server 2022 image
|
||||
FROM mcr.microsoft.com/mssql/server:2022-latest
|
||||
|
||||
# Set environment variables
|
||||
ENV ACCEPT_EULA=Y
|
||||
ENV MSSQL_PID=Express
|
||||
ENV SA_PASSWORD=YourStrong@Passw0rd
|
||||
|
||||
# Create a directory for database scripts
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy the schema files
|
||||
COPY dbo_schema_database_statements_small.sql ./schemas/
|
||||
COPY fp_schema_database_statements_small.sql ./schemas/
|
||||
COPY fw_schema_database_statements_small.sql ./schemas/
|
||||
COPY int_schema_database_statements_small.sql ./schemas/
|
||||
COPY ob_schema_database_statements_small.sql ./schemas/
|
||||
|
||||
# Create initialization script
|
||||
COPY init.sql ./
|
||||
|
||||
# Create setup script that will run the schema creation
|
||||
COPY setup.sh ./
|
||||
RUN chmod +x setup.sh
|
||||
|
||||
CMD /bin/bash ./setup.sh
|
||||
30
ef-migration/infrastructure/sql-server/init.sql
Normal file
30
ef-migration/infrastructure/sql-server/init.sql
Normal file
@ -0,0 +1,30 @@
|
||||
-- Create the database
|
||||
IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = 'st-database')
|
||||
BEGIN
|
||||
CREATE DATABASE [st-database]
|
||||
END
|
||||
GO
|
||||
|
||||
USE [st-database]
|
||||
GO
|
||||
|
||||
-- Create schemas if they don't exist
|
||||
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'dbo')
|
||||
EXEC('CREATE SCHEMA [dbo]')
|
||||
GO
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'fp')
|
||||
EXEC('CREATE SCHEMA [fp]')
|
||||
GO
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'fw')
|
||||
EXEC('CREATE SCHEMA [fw]')
|
||||
GO
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'int')
|
||||
EXEC('CREATE SCHEMA [int]')
|
||||
GO
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'ob')
|
||||
EXEC('CREATE SCHEMA [ob]')
|
||||
GO
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,38 @@
|
||||
-- SCHEMA: dbo
|
||||
|
||||
---------------------------------------------
|
||||
-- TABLES
|
||||
---------------------------------------------
|
||||
|
||||
|
||||
---------------------------------------------
|
||||
-- dbo.AMAssumptionView ------------------
|
||||
---------------------------------------------
|
||||
CREATE TABLE [dbo].[AMAssumptionView] (
|
||||
[AssumptionViewGUID] uniqueidentifier NOT NULL,
|
||||
[AssumptionGroupGUID] uniqueidentifier NOT NULL,
|
||||
[Name] nvarchar(450) NOT NULL,
|
||||
[ColumnWidths] varchar(8000) NOT NULL,
|
||||
[AssumptionJoinDataGUID] uniqueidentifier NOT NULL,
|
||||
[FolderGUID] uniqueidentifier NOT NULL,
|
||||
[IsDistributionModeActive] bit NOT NULL,
|
||||
[DistributionInfo] xml(max) NOT NULL,
|
||||
[ProviderGUID] uniqueidentifier NOT NULL,
|
||||
[CreatedDate] datetime NOT NULL,
|
||||
[CreatedBy] uniqueidentifier NOT NULL,
|
||||
[LastUsedDate] datetime NOT NULL,
|
||||
PRIMARY KEY ([AssumptionViewGUID])
|
||||
);
|
||||
GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_CreatedBy] DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreatedBy]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_LastUsedDate] DEFAULT (getdate()) FOR [LastUsedDate]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_Table_1_AssumptionViewGUID] DEFAULT (newid()) FOR [AssumptionViewGUID]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_ASSUMPTIONGROUPGUID] DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [AssumptionGroupGUID]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_NAME] DEFAULT ('') FOR [Name]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_COLUMNWIDTHS] DEFAULT ('') FOR [ColumnWidths]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_ASSUMPTIONCUBEGUID] DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [AssumptionJoinDataGUID]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_FOLDERGUID] DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [FolderGUID]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_ISDISTRIBUTIONMODEACTIVE] DEFAULT ((0)) FOR [IsDistributionModeActive]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_DISTRIBUTIONINFOXML] DEFAULT ('') FOR [DistributionInfo]; GO
|
||||
ALTER TABLE [dbo].[AMAssumptionView] ADD CONSTRAINT [DF_AMAssumptionView_PROVIDERGUID] DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [ProviderGUID]; GO
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,40 @@
|
||||
-- SCHEMA: fp
|
||||
|
||||
---------------------------------------------
|
||||
-- TABLES
|
||||
---------------------------------------------
|
||||
|
||||
|
||||
---------------------------------------------
|
||||
-- fp.APAdminPerformanceTest ------------------
|
||||
---------------------------------------------
|
||||
CREATE TABLE [fp].[APAdminPerformanceTest] (
|
||||
[TestID] uniqueidentifier NOT NULL,
|
||||
[SortOrder] int NOT NULL,
|
||||
[TestTypeID] tinyint NOT NULL,
|
||||
[TestName] nvarchar(100) NOT NULL,
|
||||
[Description] nvarchar(3000) NOT NULL,
|
||||
[BudgetConfigID] int NOT NULL,
|
||||
[SourceDimensionalityJSON] nvarchar(max) NOT NULL,
|
||||
[TestDetailJSON] nvarchar(max) NOT NULL,
|
||||
[IsActive] bit NOT NULL,
|
||||
[CreatedBy] nvarchar(1000) NOT NULL,
|
||||
[Target] int NOT NULL,
|
||||
[MaximumTheshold] int NOT NULL,
|
||||
[PickableDepartments] nvarchar(max) NOT NULL,
|
||||
PRIMARY KEY ([TestID])
|
||||
);
|
||||
GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__Targe__5375AD4D] DEFAULT ((0)) FOR [Target]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__Maxim__5469D186] DEFAULT ((0)) FOR [MaximumTheshold]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__Picka__565219F8] DEFAULT ('') FOR [PickableDepartments]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__TestI__6B4249E6] DEFAULT (newid()) FOR [TestID]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__SortO__6C366E1F] DEFAULT ((0)) FOR [SortOrder]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__TestT__6D2A9258] DEFAULT ((0)) FOR [TestTypeID]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__TestN__6E1EB691] DEFAULT ('') FOR [TestName]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__Descr__6F12DACA] DEFAULT ('') FOR [Description]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__Budge__70FB233C] DEFAULT ((0)) FOR [BudgetConfigID]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__Sourc__71EF4775] DEFAULT ('') FOR [SourceDimensionalityJSON]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__TestD__72E36BAE] DEFAULT ('') FOR [TestDetailJSON]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__IsAct__73D78FE7] DEFAULT ((0)) FOR [IsActive]; GO
|
||||
ALTER TABLE [fp].[APAdminPerformanceTest] ADD CONSTRAINT [DF__APAdminPe__Creat__74CBB420] DEFAULT ('') FOR [CreatedBy]; GO
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,22 @@
|
||||
-- SCHEMA: fw
|
||||
|
||||
---------------------------------------------
|
||||
-- TABLES
|
||||
---------------------------------------------
|
||||
|
||||
|
||||
---------------------------------------------
|
||||
-- fw.ABBBudgetedCostPerRVU ------------------
|
||||
---------------------------------------------
|
||||
CREATE TABLE [fw].[ABBBudgetedCostPerRVU] (
|
||||
[DepartmentID] int NOT NULL,
|
||||
[AccountID] int NOT NULL,
|
||||
[JobCodeID] int NOT NULL,
|
||||
[PayCodeID] int NOT NULL,
|
||||
[CostComponentID] int NOT NULL,
|
||||
[CostingConfigGuid] uniqueidentifier NOT NULL,
|
||||
[VariableDirectUnitCostPerRVU] decimal NULL,
|
||||
[TotalVariableDirectCost] decimal NULL,
|
||||
[TotalCost] decimal NULL
|
||||
);
|
||||
GO
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,22 @@
|
||||
-- SCHEMA: int
|
||||
|
||||
---------------------------------------------
|
||||
-- TABLES
|
||||
---------------------------------------------
|
||||
|
||||
|
||||
---------------------------------------------
|
||||
-- int.AggregatePostDIHistory ------------------
|
||||
---------------------------------------------
|
||||
CREATE TABLE [int].[AggregatePostDIHistory] (
|
||||
[AggregatePostDIHistoryGuid] uniqueidentifier NOT NULL,
|
||||
[CreatedAtUtc] datetime NOT NULL,
|
||||
[LastRanUtc] datetime NOT NULL,
|
||||
[AggregatePostDIStatus] int NOT NULL,
|
||||
PRIMARY KEY ([AggregatePostDIHistoryGuid])
|
||||
);
|
||||
GO
|
||||
ALTER TABLE [int].[AggregatePostDIHistory] ADD CONSTRAINT [DF__Aggregate__Aggre__4EDF0E15] DEFAULT (newid()) FOR [AggregatePostDIHistoryGuid]; GO
|
||||
ALTER TABLE [int].[AggregatePostDIHistory] ADD CONSTRAINT [DF__Aggregate__Creat__4FD3324E] DEFAULT (getutcdate()) FOR [CreatedAtUtc]; GO
|
||||
ALTER TABLE [int].[AggregatePostDIHistory] ADD CONSTRAINT [DF__Aggregate__LastR__50C75687] DEFAULT ('1900-01-01 00:00:00.000') FOR [LastRanUtc]; GO
|
||||
ALTER TABLE [int].[AggregatePostDIHistory] ADD CONSTRAINT [DF__Aggregate__Aggre__51BB7AC0] DEFAULT ((0)) FOR [AggregatePostDIStatus]; GO
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
||||
-- SCHEMA: ob
|
||||
|
||||
---------------------------------------------
|
||||
-- TABLES
|
||||
---------------------------------------------
|
||||
|
||||
|
||||
---------------------------------------------
|
||||
-- ob.AccountVariabilityOverride ------------------
|
||||
---------------------------------------------
|
||||
CREATE TABLE [ob].[AccountVariabilityOverride] (
|
||||
[AccountVariabilityOverrideID] int NOT NULL,
|
||||
[DepartmentAssignment] nvarchar(800) NOT NULL,
|
||||
[AccountAssignment] nvarchar(800) NOT NULL,
|
||||
[PrecedentOrder] int NOT NULL,
|
||||
[Variability] decimal NOT NULL,
|
||||
PRIMARY KEY ([AccountVariabilityOverrideID])
|
||||
);
|
||||
GO
|
||||
ALTER TABLE [ob].[AccountVariabilityOverride] ADD CONSTRAINT [DF__AccountVa__Depar__0EB4746A] DEFAULT ('') FOR [DepartmentAssignment]; GO
|
||||
ALTER TABLE [ob].[AccountVariabilityOverride] ADD CONSTRAINT [DF__AccountVa__Accou__0FA898A3] DEFAULT ('') FOR [AccountAssignment]; GO
|
||||
ALTER TABLE [ob].[AccountVariabilityOverride] ADD CONSTRAINT [DF__AccountVa__Prece__109CBCDC] DEFAULT ((0)) FOR [PrecedentOrder]; GO
|
||||
ALTER TABLE [ob].[AccountVariabilityOverride] ADD CONSTRAINT [DF__AccountVa__Varia__1190E115] DEFAULT ((0)) FOR [Variability]; GO
|
||||
|
||||
0
ef-migration/infrastructure/sql-server/setup.sh
Normal file
0
ef-migration/infrastructure/sql-server/setup.sh
Normal file
Loading…
Reference in New Issue
Block a user