From 889ee1d2b681b7887ced8e3df9a3d2773a599442 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Thu, 10 Mar 2022 08:39:11 +0100 Subject: [PATCH] Database: added table script files --- src/sql/tables/Auction.sql | 10 ++++++++++ src/sql/tables/Image.sql | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 src/sql/tables/Auction.sql create mode 100644 src/sql/tables/Image.sql diff --git a/src/sql/tables/Auction.sql b/src/sql/tables/Auction.sql new file mode 100644 index 0000000..b0da252 --- /dev/null +++ b/src/sql/tables/Auction.sql @@ -0,0 +1,10 @@ +CREATE TABLE IF NOT EXISTS "Auction" ( + "id" INTEGER NOT NULL UNIQUE, + "user_id" INTEGER NOT NULL, + "title" TEXT NOT NULL, + "description" TEXT NOT NULL, + "init_price" INTEGER NOT NULL DEFAULT 1, + "start_time" DATE NOT NULL, + "end_time" DATE NOT NULL, + PRIMARY KEY("id" AUTOINCREMENT) +); diff --git a/src/sql/tables/Image.sql b/src/sql/tables/Image.sql new file mode 100644 index 0000000..fea64d9 --- /dev/null +++ b/src/sql/tables/Image.sql @@ -0,0 +1,7 @@ +CREATE TABLE IF NOT EXISTS "Image" ( + "id" INTEGER NOT NULL UNIQUE, + "auction_id" INTEGER NOT NULL, + "image_order" INTEGER NOT NULL DEFAULT 0, + "url" TEXT NOT NULL, + PRIMARY KEY("id" AUTOINCREMENT) +);