GMBuddy / gmbuddy-backend

0 stars 0 forks source link

GMBuddy Backend

CircleCI

Installation

Pre-requisites

Steps

Development

Database

Right now, the project is configured to use SQLite, which will work on Windows, macOS, and Linux. Download SQLite command line tools from the SQLite project website to interact with the database

The project is also configured to optionally use SQL Server Express, which can be installed alongside Visual Studio Community or using this link. It requires Windows 7 or later. SQLite has proven to be difficult to work with in Entity Framework Core -- specifically, updates to models require database migrations in EF Core, and SQLite (or, at least, Microsoft's SQLite driver) does not support a number of ALTER statements, meaning that every time we made a model change, we had to completely wipe and re-create the database. While the loss of data in this process was not bad, it was annoying to have to do every time we updated a model, which at this point still happens rather frequently. If you want to keep testing data around more frequently and you are on Windows, use SQL Express. We will soon be integrating an environment variable to switch which database is used.

A script, create-sqlserver.ps1, currently handles the much more infrequent process of clobbering and re-creating the SQL Server Express database. It assumes that you store your mdf files in $env:USERPROFILE, which is usually C:\Users\username. If this is not the case for you, submit a pull request to fix it.