scripts (create-sqlite-db): move to `scripts` dir and edit it

This commit is contained in:
MedzikUser 2022-04-16 21:33:05 +02:00
parent c5b76d8b90
commit e6f5be15e4
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
3 changed files with 13 additions and 6 deletions

View File

@ -2,6 +2,4 @@
## 🖴 Create SQLite Database
```bash
sqlite3 homedisk.db < tables.sql
```
Run file `./scripts/create-sqlite-database.sh` to create SQLite database file.

View File

@ -0,0 +1,12 @@
#!/bin/bash
if [ -f 'homedisk.db' ]
then
echo 'Database `homedisk.db` exists!'
exit 1
fi
# create a database using the commands from the `tables.sql` file
sqlite3 homedisk.db < tables.sql
echo 'Created SQLite database `homedisk.db`!'

View File

@ -1,3 +0,0 @@
#!/bin/bash
sqlite3 homedisk.db < tables.sql