From d583e0f5f8cd263d5a07101cf56446dfa4de03c6 Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Tue, 2 Mar 2021 10:49:54 -0300 Subject: [PATCH] Adding database fields Date and Time in create tables queries. --- src/app/database/db.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/app/database/db.js b/src/app/database/db.js index 7d66d50..09cf1f6 100644 --- a/src/app/database/db.js +++ b/src/app/database/db.js @@ -1,37 +1,44 @@ // FIXME: Refactor to our database ERM already combined const init_queries = [ - `CREATE TABLE IF NOT EXISTS FloodZones ( + `CREATE TABLE IF NOT EXISTS FloodZones ( Id integer PRIMARY KEY autoincrement, Description text, Images text, Latitude real NOT NULL, Longitude real NOT NULL, - Passable INTERGER NOT NULL + Passable INTERGER NOT NULL, + Date text, + Time text );`, - `CREATE TABLE IF NOT EXISTS Pluviometer ( + `CREATE TABLE IF NOT EXISTS Pluviometer ( Id integer PRIMARY KEY autoincrement, Date text NOT NULL, Images text, Latitude real NOT NULL, Longitude real NOT NULL, - Precipitation real NOT NULL + Precipitation real NOT NULL, + Time text );`, - `CREATE TABLE IF NOT EXISTS RainLevel ( + `CREATE TABLE IF NOT EXISTS RainLevel ( Id integer PRIMARY KEY autoincrement, Description text, RainIdx INTEGER NOT NULL, Images text, Latitude real NOT NULL, - Longitude real NOT NULL + Longitude real NOT NULL, + Date text, + Time text );`, - `CREATE TABLE IF NOT EXISTS RiverLevel ( + `CREATE TABLE IF NOT EXISTS RiverLevel ( Id integer PRIMARY KEY autoincrement, Description text, RiverIdx INTEGER NOT NULL, Images text, Latitude real NOT NULL, - Longitude real NOT NULL + Longitude real NOT NULL, + Date text, + Time text );`, ];