Initial commit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
16
backend/db/migrations/001_create_exercises.up.sql
Executable file
16
backend/db/migrations/001_create_exercises.up.sql
Executable file
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE exercises (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name TEXT NOT NULL CHECK(length(name) >= 1 AND length(name) <= 100),
|
||||
description TEXT DEFAULT '',
|
||||
muscle_group TEXT NOT NULL CHECK(muscle_group IN (
|
||||
'brust', 'ruecken', 'schultern', 'bizeps', 'trizeps',
|
||||
'beine', 'bauch', 'ganzkoerper', 'sonstiges'
|
||||
)),
|
||||
weight_step_kg REAL NOT NULL DEFAULT 2.5 CHECK(weight_step_kg > 0),
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted_at DATETIME
|
||||
);
|
||||
|
||||
CREATE INDEX idx_exercises_muscle_group ON exercises(muscle_group) WHERE deleted_at IS NULL;
|
||||
CREATE INDEX idx_exercises_deleted_at ON exercises(deleted_at);
|
||||
Reference in New Issue
Block a user