ibs/mkdb.sh
HeshamTB 2c17903012
init: server workds with tls, needs database models
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-03-03 14:42:02 +03:00

27 lines
554 B
Bash
Executable File

#!/bin/bash
# Make a new database
# Mar 3, 2022 - H.B.
if [ -z ${1} ]
then
echo "Enter a databse name to use this"
exit 1
fi
sqlite3 ${1} << EOF
CREATE TABLE user_accounts(
id INTEGER(512) PRIMARY KEY NOT NULL,
username TEXT(64) NOT NULL,
date_created datetime ,
digest TEXT NOT NULL,
salt TEXT
);
CREATE TABLE iot_entity(
id INTEGER(512) PRIMARY KEY NOT NULL,
description TEXT,
last_connection datetime,
);
EOF