-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start setting up migrations and writing initial SQL
Will most likely use SQLite, though the script has not been verified yet.
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="Program.fs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.6" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[<EntryPoint>] | ||
let main args = | ||
let connectionString = "" | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
PRAGMA foreign_keys = ON; | ||
|
||
CREATE TABLE | ||
user (id INT PRIMARY KEY, discord_id TEXT); | ||
|
||
CREATE TABLE | ||
exercise ( | ||
id INT PRIMARY KEY, | ||
name TEXT NOT NULL, | ||
type TEXT NOT NULL, | ||
user_id INT NOT NULL, | ||
FOREIGN KEY (user_id) REFERENCES user (id) | ||
); | ||
|
||
CREATE TABLE | ||
exercise_log (id INT PRIMARY KEY); | ||
|
||
CREATE TABLE | ||
all_set_details ( | ||
id INT PRIMARY KEY, | ||
exercise_log_id INT NOT NULL, | ||
FOREIGN KEY (exercise_log_id) REFERENCES exercise_log (id) | ||
); | ||
|
||
CREATE TABLE | ||
set_exercise_details ( | ||
id INT PRIMARY KEY, | ||
reps INT NOT NULL, | ||
weight INT NOT NULL, | ||
is_warmup BOOLEAN NOT NULL, | ||
all_set_details_id INT NOT NULL, | ||
FOREIGN KEY (all_set_details_id) REFERENCES all_set_details (id) | ||
); | ||
|
||
CREATE TABLE | ||
speed_exercise_details ( | ||
id INT PRIMARY KEY, | ||
duration_sec INT NOT NULL distance_miles REAL NOT NULL, | ||
exercise_log_id INT NOT NULL, | ||
FOREIGN KEY (exercise_log_id) REFERENCES exercise_log (id) | ||
); | ||
|
||
CREATE TABLE | ||
time_exercise_details ( | ||
id INT PRIMARY KEY, | ||
duration_sec INT NOT NULL, | ||
exercise_log_id INT NOT NULL, | ||
FOREIGN KEY (exercise_log_id) REFERENCES exercise_log (id), | ||
); |