update
This commit is contained in:
@@ -18,6 +18,34 @@ import sqlite3
|
||||
conn = sqlite3.connect("/var/www/moduleair_pro_4g/sqlite/sensors.db")
|
||||
cursor = conn.cursor()
|
||||
|
||||
#create a config table
|
||||
cursor.execute("""
|
||||
CREATE TABLE IF NOT EXISTS config_table (
|
||||
key TEXT PRIMARY KEY,
|
||||
value TEXT NOT NULL,
|
||||
type TEXT NOT NULL
|
||||
)
|
||||
""")
|
||||
|
||||
#creates a config_scripts table
|
||||
cursor.execute('''
|
||||
CREATE TABLE IF NOT EXISTS config_scripts_table (
|
||||
script_path TEXT PRIMARY KEY,
|
||||
enabled INTEGER NOT NULL
|
||||
)
|
||||
''')
|
||||
|
||||
#creates a config table for envea sondes
|
||||
cursor.execute("""
|
||||
CREATE TABLE IF NOT EXISTS envea_sondes_table (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
connected INTEGER NOT NULL,
|
||||
port TEXT NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
coefficient REAL NOT NULL
|
||||
)
|
||||
""")
|
||||
|
||||
# Create a table timer
|
||||
cursor.execute("""
|
||||
CREATE TABLE IF NOT EXISTS timestamp_table (
|
||||
@@ -30,6 +58,14 @@ cursor.execute("""
|
||||
VALUES (1, CURRENT_TIMESTAMP);
|
||||
""")
|
||||
|
||||
#create a modem status table
|
||||
cursor.execute("""
|
||||
CREATE TABLE IF NOT EXISTS modem_status (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
timestamp TEXT,
|
||||
status TEXT
|
||||
)
|
||||
""")
|
||||
|
||||
# Create a table NPM
|
||||
cursor.execute("""
|
||||
|
||||
Reference in New Issue
Block a user