https://github.com/vkhorikov/databaseupgradetool
Light-weight tool for keeping track of your SQL database schema version
https://github.com/vkhorikov/databaseupgradetool
Last synced: 5 months ago
JSON representation
Light-weight tool for keeping track of your SQL database schema version
- Host: GitHub
- URL: https://github.com/vkhorikov/databaseupgradetool
- Owner: vkhorikov
- Created: 2015-07-31T17:24:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-25T19:18:56.000Z (over 6 years ago)
- Last Synced: 2023-02-26T23:23:35.316Z (about 2 years ago)
- Language: C#
- Size: 31.3 KB
- Stars: 73
- Watchers: 13
- Forks: 23
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Database upgrade tool
Light-weight tool for keeping track of your SQL database schema versionAbout
=====================This is a database upgrade tool that works with .NET and SQL Server specifically. It is extremely light-weight: consists of only 4 classes (including Program.cs).
The best practices behind this tool are described in my [Pluralsight course][L6].
How to Get Started
--------------
To start applying the migration-based approach to database delivery, you need to create a baseline script (the script containing all the objects your database has so far) and place it to [Migrations][L5] as "01_Base.sql".After that, you need to adjust the [connection string][L4] and you are good to go.
How to Use the Tool
--------------
The best way to use the tool is to copy it to your solution as a separate project:
After that, you can add new migrations to the Scripts folder and execute them just by hitting F5:

**Warning!** Don't forget to mark the files in the Scripts folder as Content, Copy Always:

What if one of the scripts fails?
--------------
The tool executes the scripts in a transactional manner. If for example migration #4 contains an error which results in an exception, the tool will execute migrations 1, 2, and 3; migration 4 will be rollbacked entirely. The database would be marked as of version 3.Licence
--------------
[Apache 2 License][L2][L2]: http://www.apache.org/licenses/LICENSE-2.0
[L4]: src/DatabaseUpgradeTool/App.config
[L5]: src/DatabaseUpgradeTool/Migrations
[L6]: https://www.pluralsight.com/courses/database-delivery-best-practices