scripts (create-sqlite-db): move to `scripts` dir and edit it
This commit is contained in:
parent
c5b76d8b90
commit
e6f5be15e4
|
@ -2,6 +2,4 @@
|
||||||
|
|
||||||
## 🖴 Create SQLite Database
|
## 🖴 Create SQLite Database
|
||||||
|
|
||||||
```bash
|
Run file `./scripts/create-sqlite-database.sh` to create SQLite database file.
|
||||||
sqlite3 homedisk.db < tables.sql
|
|
||||||
```
|
|
||||||
|
|
|
@ -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`!'
|
Loading…
Reference in New Issue