Added sql script to create tables

This commit is contained in:
GabePope
2022-07-15 22:18:45 +10:00
parent cefb848ef2
commit b4bda66742
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
CREATE TABLE IF NOT EXISTS "Person" (
"PersonId" INTEGER,
"Name" TEXT,
PRIMARY KEY("PersonId" AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS "Workout" (
"WorkoutId" INTEGER,
"PersonId" INTEGER,
"StartDate" TEXT NOT NULL,
PRIMARY KEY("WorkoutId" AUTOINCREMENT),
FOREIGN KEY("PersonId") REFERENCES Person (PersonId)
);
CREATE TABLE IF NOT EXISTS "TopSet" (
"TopSetId" INTEGER,
"WorkoutId" INTEGER,
"ExcerciseId" INTEGER,
"Repetitions" INTEGER,
"Weight" INTEGER,
PRIMARY KEY("TopSetId" AUTOINCREMENT),
FOREIGN KEY("WorkoutId") REFERENCES Workout (WorkoutId),
FOREIGN KEY("ExcerciseId") REFERENCES Excercise (ExcerciseId)
);
CREATE TABLE IF NOT EXISTS "Excercise" (
"ExcerciseId" INTEGER,
"Name" TEXT,
PRIMARY KEY("ExcerciseId" AUTOINCREMENT)
);