mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
SQL Migration Extension Skeleton (#11625)
* Start on skeleton * Finish up skeleton * . * Change up the skeleton a bit, add some states.
This commit is contained in:
@@ -222,7 +222,8 @@ const externalExtensions = [
|
|||||||
'sql-database-projects',
|
'sql-database-projects',
|
||||||
'machine-learning',
|
'machine-learning',
|
||||||
'sql-assessment',
|
'sql-assessment',
|
||||||
'asde-deployment'
|
'asde-deployment',
|
||||||
|
'sql-migration'
|
||||||
];
|
];
|
||||||
// extensions that require a rebuild since they have native parts
|
// extensions that require a rebuild since they have native parts
|
||||||
const rebuildExtensions = [
|
const rebuildExtensions = [
|
||||||
|
|||||||
@@ -256,7 +256,8 @@ const externalExtensions = [
|
|||||||
'sql-database-projects',
|
'sql-database-projects',
|
||||||
'machine-learning',
|
'machine-learning',
|
||||||
'sql-assessment',
|
'sql-assessment',
|
||||||
'asde-deployment'
|
'asde-deployment',
|
||||||
|
'sql-migration'
|
||||||
];
|
];
|
||||||
|
|
||||||
// extensions that require a rebuild since they have native parts
|
// extensions that require a rebuild since they have native parts
|
||||||
|
|||||||
BIN
extensions/sql-migration/images/extension.png
Normal file
BIN
extensions/sql-migration/images/extension.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
41
extensions/sql-migration/package.json
Normal file
41
extensions/sql-migration/package.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"name": "sql-migration",
|
||||||
|
"displayName": "%displayName%",
|
||||||
|
"description": "%description%",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"publisher": "Microsoft",
|
||||||
|
"preview": true,
|
||||||
|
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
|
||||||
|
"icon": "images/extension.png",
|
||||||
|
"engines": {
|
||||||
|
"vscode": "^1.25.0",
|
||||||
|
"azdata": ">=1.19.0"
|
||||||
|
},
|
||||||
|
"activationEvents": [
|
||||||
|
"onCommand:sqlmigration.start"
|
||||||
|
],
|
||||||
|
"main": "./out/main",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
||||||
|
},
|
||||||
|
"extensionDependencies": [
|
||||||
|
"Microsoft.mssql"
|
||||||
|
],
|
||||||
|
"contributes": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"command": "sqlmigration.start",
|
||||||
|
"title": "SQL Migration Start",
|
||||||
|
"category": "SQL Migration"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"vscode-nls": "^3.2.1"
|
||||||
|
},
|
||||||
|
"__metadata": {
|
||||||
|
"publisherDisplayName": "Microsoft",
|
||||||
|
"publisherId": "Microsoft"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
extensions/sql-migration/package.nls.json
Normal file
4
extensions/sql-migration/package.nls.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"displayName": "SQL Migration",
|
||||||
|
"description": "SQL migration description"
|
||||||
|
}
|
||||||
39
extensions/sql-migration/src/main.ts
Normal file
39
extensions/sql-migration/src/main.ts
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import { ExtensionContext, Disposable, commands, window } from 'vscode';
|
||||||
|
|
||||||
|
class SQLMigration {
|
||||||
|
|
||||||
|
constructor(private readonly context: ExtensionContext) {
|
||||||
|
}
|
||||||
|
|
||||||
|
async start(): Promise<void> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async registerCommands(): Promise<void> {
|
||||||
|
const commandDisposables: Disposable[] = [ // Array of disposables returned by registerCommand
|
||||||
|
commands.registerCommand('sqlmigration.start', () => {
|
||||||
|
window.showInformationMessage('Command ran');
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
this.context.subscriptions.push(...commandDisposables);
|
||||||
|
}
|
||||||
|
|
||||||
|
stop(): void {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let sqlMigration: SQLMigration;
|
||||||
|
export async function activate(context: ExtensionContext) {
|
||||||
|
sqlMigration = new SQLMigration(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deactivate(): void {
|
||||||
|
sqlMigration.stop();
|
||||||
|
}
|
||||||
22
extensions/sql-migration/src/models/stateMachine.ts
Normal file
22
extensions/sql-migration/src/models/stateMachine.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
export enum State {
|
||||||
|
COLLECTING_SOURCE_INFO,
|
||||||
|
COLLECTION_SOURCE_INFO_ERROR,
|
||||||
|
TARGET_SELECTION,
|
||||||
|
TARGET_SELECTION_ERROR,
|
||||||
|
AZURE_SERVER_SELECTION,
|
||||||
|
AZURE_SERVER_SELECTION_ERROR,
|
||||||
|
AZURE_DB_BACKUP,
|
||||||
|
AZURE_DB_BACKUP_ERROR,
|
||||||
|
MIGRATION_AGENT_CREATION,
|
||||||
|
MIGRATION_AGENT_SELECTION,
|
||||||
|
MIGRATION_AGENT_ERROR,
|
||||||
|
MIGRATION_START,
|
||||||
|
NO_AZURE_SERVER,
|
||||||
|
EXIT,
|
||||||
|
}
|
||||||
|
|
||||||
9
extensions/sql-migration/src/typings/ref.d.ts
vendored
Normal file
9
extensions/sql-migration/src/typings/ref.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||||
|
/// <reference path='../../../../src/sql/azdata.d.ts'/>
|
||||||
|
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
|
||||||
|
/// <reference types='@types/node'/>
|
||||||
14
extensions/sql-migration/src/wizard/wizardController.ts
Normal file
14
extensions/sql-migration/src/wizard/wizardController.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
export class WizardController {
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public async openWizard(): Promise<void> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
20
extensions/sql-migration/tsconfig.json
Normal file
20
extensions/sql-migration/tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"extends": "../shared.tsconfig.json",
|
||||||
|
"compileOnSave": true,
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "commonjs",
|
||||||
|
"outDir": "./out",
|
||||||
|
"lib": [
|
||||||
|
"es6", "es2015.promise"
|
||||||
|
],
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"declaration": false,
|
||||||
|
"strict": true,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
|
}
|
||||||
8
extensions/sql-migration/yarn.lock
Normal file
8
extensions/sql-migration/yarn.lock
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||||
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
|
vscode-nls@^3.2.1:
|
||||||
|
version "3.2.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.5.tgz#25520c1955108036dec607c85e00a522f247f1a4"
|
||||||
|
integrity sha512-ITtoh3V4AkWXMmp3TB97vsMaHRgHhsSFPsUdzlueSL+dRZbSNTZeOmdQv60kjCV306ghPxhDeoNUEm3+EZMuyw==
|
||||||
Reference in New Issue
Block a user