create create/delete/view function for boats

This commit is contained in:
2023-07-22 13:57:17 +02:00
parent 6e61cce1ec
commit c0bb6d51de
8 changed files with 438 additions and 4 deletions

View File

@ -74,7 +74,7 @@ CREATE TABLE IF NOT EXISTS "boat" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" text NOT NULL UNIQUE,
"amount_seats" integer NOT NULL,
"location_id" INTEGER NOT NULL REFERENCES location(id),
"location_id" INTEGER NOT NULL REFERENCES location(id) DEFAULT 1,
"owner" INTEGER REFERENCES user(id), -- null: club is owner
"year_built" INTEGER,
"boatbuilder" TEXT,
@ -111,7 +111,7 @@ CREATE TABLE IF NOT EXISTS "boat_damage" (
"boat_id" INTEGER NOT NULL REFERENCES boat(id),
"desc" text not null,
"user_id_created" INTEGER NOT NULL REFERENCES user(id),
"created_at" text not null,
"created_at" text not null default CURRENT_TIMESTAMP,
"user_id_fixed" INTEGER REFERENCES user(id), -- none: not fixed yet
"fixed_at" text,
"user_id_verified" INTEGER REFERENCES user(id),