You are previewing SQL Server Source Control Basics.
O'Reilly logo
SQL Server Source Control Basics

Book Description

Source control can and should play a key role in the database development and deployment process, and this book will show you exactly how to get started.

Table of Contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Table of Contents
  5. Foreword: A Brief History of Source Control
  6. About the Authors and Technical Reviewers
  7. Introduction
  8. The Hands-On Examples
  9. Chapter 1: Core Source Control Concepts
    1. Why Source Control?
    2. The Source Control Repository
    3. The Working Folder
    4. Versioning and Collaborative Editing
      1. How Versioning Works
      2. Collaborative Editing
    5. Branching
    6. Merging
    7. Summary
  10. Chapter 2: The Source Control Repository
    1. Centralized versus Distributed Repositories
      1. Centralized Repositories
      2. Distributed Repositories
      3. Comparing Centralized and Distributed Repositories
    2. Choosing a VCS for Database Development
    3. Versioning a Project in the Repository
    4. Getting Started with Source Control
      1. Setting up Subversion
      2. Setting up the Repository
      3. Setting up the Working Folders
    5. We've only just Begun
  11. Chapter 3: Getting Started with Source Control for Databases
    1. Planning for Database Source Control
      1. Integrated Development Environment (IDE) integration
      2. Disconnected versus Online Database Development
      3. Shared versus Dedicated Database Development
      4. Source Control and Application Lifecycle Management
      5. Database Build and Deploy Considerations
      6. Database Versioning Challenges
      7. Database Source Control Architecture
    2. Getting the Bookstore Database into Source Control
      1. Script Database Objects for Source Control
      2. Create, Add and Commit Database Scripts
      3. Updating the Working Folder
    3. Summary
  12. Chapter 4: Editing and Versioning
    1. Database Versioning Strategies
      1. Versioning Code Modules
      2. Versioning Tables
    2. Source Control Versioning Mechanisms
      1. Version Numbering and History
      2. Deltas and Diffs
    3. Modifying the Bookstore Database
    4. Investigating Bookstore Revision History
      1. Diffing Files in Bookstore
    5. What to do when Things Go Wrong: Revert
    6. The World of Source Control
  13. Chapter 5: Branches and Tags
    1. How Branching Works
    2. Branching Strategies
      1. No Branching
      2. Branch when Needed (Release Branches)
      3. Feature Branches
      4. Branching Strategy for Database Development
    3. Tags
    4. Branching in SVN
      1. Create the Branch in the Repository
      2. Update the Working Folders
      3. Switching the Working Folder
      4. Modifying the Branch
      5. Diffing between Branches and the Trunk
    5. Creating Tags in SVN
    6. Summary
  14. Chapter 6: Merging
    1. How to Avoid Painful Merges
    2. How Merging Works
      1. Intra-Branch Merges: Conflicting Changes on the Same Branch
      2. Inter-Branch Merges: Moving Changes between Branches
    3. How to Merge in SVN
      1. Intra-Branch Merges in SVN
      2. Inter-Branch Merging in SVN
    4. Summary
  15. Chapter 7: Manually Deploying Databases from Source Control
    1. Database Deployment Pitfalls
      1. Version Drift
      2. Lack of Upgrade Script Testing
      3. No Rollback Plan
    2. Building and Deploying Databases
      1. Database Build Numbers
      2. Deploying a New Database Build
      3. Upgrading an Existing Database
    3. Deploying a New Build of the Bookstore Database
      1. Saving Database Backup Files
      2. Create the Build Table
      3. Create a Tag for the Latest Bookstore Revision
      4. Create the Build Script
      5. Run the New Build
    4. Upgrading the Bookstore Database
      1. Preparing the Environment
      2. Creating the Upgrade Scripts
      3. Preparing to Deploy
      4. Deploy the Upgrade
    5. Automating Deployments for Upgrade Script Versioning
    6. Source Control and Database Deployment
  16. Chapter 8: Automating Database Versioning and Deployment from Source Control
    1. Versioning the Database
      1. CREATE Scripts versus Upgrade Scripts
      2. Deployment challenges
      3. Choosing a Versioning Approach
    2. Automation for CREATE Script Versioning and Deployment
    3. Automated Versioning and Deployment for Bookstore
      1. Versioning Databases with SQL Source Control
      2. Versioning the Existing Bookstore Database
      3. Modifying Bookstore
      4. Deploying Databases with SQL Compare
    4. Database Versioning and Deployment with Continuous Integration
    5. Summary