For developers building data access libraries, components or any piece or code reading or writing in a database, it's useful to have a database schema with the most common conditions found in a real-worl application. One of the sample database used by developers to achieve this is the AdventureWorks sample database for SQLServer
This database sample an other databases can be found in the link: https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/downloading-sample-databases
This project is an effort for having a common database schema for other database provider just than SqlServer
Note: This project creates only the database schema, without data.
- Clone the repository in you local development folder
- Run
dotnet build src/apsys.adventureworks.migrations.sln
- Create a database in your database instance with name 'AdventureWorks'. This name is optional. Just take care that the name matches with the database's name used in the connection string passed in the step 5
- Open a console and change the location to the build result folder. Depending of your configuration, this folder can be like
src/apsys.adventureworks.migrations/bin/debug/netcoreapp3.1/
- On the build result folder execute
apsys.adventureworks.migrations.exe /cnn:"YourSqlServerDatabaseConnectionStringHere" /provider:"YouProviderName"
YouProviderName must be replaced with the name of the database provider. Use sqlserver for Microsoft SqlServer database. Use mysql for MySql database
YourSqlServerDatabaseConnectionStringHere must be replaced with the connection string to your database. For Microsoft SqlServer can be like Server=localhost\SQLEXPRESS;Database=AdventureWorks;Trusted_Connection=True;
https://github.com/fluentmigrator/fluentmigrator
Fluent Migrator is a migration framework for .NET. It's used to control the changes realized in the database schemas. It allows to keep on single base code for all supported databases