From 45a3b94f133ebcd9abff2baf266d0b3f691d2790 Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Sat, 1 May 2021 09:43:59 +0530 Subject: defined api group to handle DB functions regarding people/customers --- server/database/main.go | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'server/database/main.go') diff --git a/server/database/main.go b/server/database/main.go index ecff904..de2365c 100644 --- a/server/database/main.go +++ b/server/database/main.go @@ -17,17 +17,26 @@ var myDatabase *sql.DB func StartDB() { myDatabase, _ = sql.Open("sqlite3", "./openbills.db") - init_registered_items, _ := myDatabase.Prepare( - `CREATE TABLE IF NOT EXISTS registered_items + init_items, _ := myDatabase.Prepare( + `CREATE TABLE IF NOT EXISTS Items (id INTEGER PRIMARY KEY AUTOINCREMENT, - model TEXT NOT NULL, - desc TEXT, - price REAL, - hsn BLOB, - gst REAL, - category TEXT, - brand TEXT)`, + Model TEXT NOT NULL, + Desc TEXT, + Price REAL, + Hsn BLOB, + Gst REAL, + Category TEXT, + Brand TEXT)`, ) - init_registered_items.Exec() + init_items.Exec() + + init_people, _ := myDatabase.Prepare( + `CREATE TABLE IF NOT EXISTS People + (id INTEGER PRIMARY KEY AUTOINCREMENT, + Name TEXT, + Phone TEXT, + Email TEXT)`, + ) + init_people.Exec() } -- cgit v1.2.3