Create Custom Database Refactoring Types or Targets

Visual Studio Team System Database Edition provides four common refactoring types: Rename, Move to Schema, Fully Qualify Name, and Expand Wildcard Characters. You can create custom refactoring types or targets to automate additional repetitive database development tasks. If your team must perform additional repetitive tasks, you can create a feature extension for refactoring, to enable your developers to perform those tasks more easily and with fewer errors. You can also extend the existing refactoring types to operate on new targets, such as new file types, by creating a new refactoring contributor.

Deploying Custom Refactoring Types and Targets

After you verify that your new refactoring type or target works correctly, you must distribute it to your team. Each person who wants to use your refactoring type or target must register it on the computer on which they will use it. You can ask each team member to install and register the feature extension manually, or you can create a simple installation program for it.

Common Tasks

The following table lists descriptions of common tasks that support creating and deploying custom types or targets, plus links to more information about how you can successfully complete those tasks.

Common Task

Supporting Content

Learn about how refactoring components interact with Database Edition extensibility: Typically, when you create a new refactoring type, you have to interact with the Schema Model, the Script Domain Object Model (Script DOM), or both.

Overview of Extensibility for Database Refactoring

Get hands-on experience: You can create an example refactoring type that will convert the first letter of the name of the selected object to uppercase. You can also extend an existing refactoring type to support a file type.

Walkthrough: Creating a New Type of Database Refactoring to Change Casing

Walkthrough: Extending Database Rename Refactoring to Operate on Text Files

Install and register a refactoring type or target: Before you can use a custom refactoring type, you must install the assembly that contains the definition for that type. Then, you must register the condition.

How to: Register and Manage Feature Extensions

Distribute refactoring types or targets to team members: Each member of your team who wants to use the new refactoring type must have the associated assemblies installed on their computer. You can ask each team member to install and register the feature extension manually, or you can create a simple installation program for it.

How to: Distribute Custom Feature Extensions to Team Members

  • Extending the Features of Database Edition
    Before you create and deploy new refactoring types or targets, you can get a better understanding of the types of extensibility that are supported in Database Edition.

  • Refactor Database Code and Data
    You can use database refactoring to reduce the time and effort required to perform some repetitive database development tasks, such as renaming all references to an object or moving an object to a different schema.

See Also

Concepts

Terminology Overview of Database Edition