ketr.photos/server/db/MODIFY.md
James Ketrenos e5a55de73c Improved face dropping from photopanel
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
2023-01-28 20:19:52 -08:00

53 lines
607 B
Markdown

# Dump schema
```bash
cat << EOF | sqlite3 db/photos.db > photos.schema
.schema
EOF
```
# Edit schema
```bash
nano photos.schema
```
# Backup database
```bash
cp db/photos.db photos.db.bk
```
# For the table you want to modify
## Backup the table
```bash
cat << EOF | sqlite3 db/photos.db
.output faces.dump
.dump faces
.quit
EOF
```
## Drop the table
```bash
cat << EOF | sqlite3 db/photos.db
drop table faces
EOF
```
## Create the table with the modified schema
```bash
cat photos.schema | sqlite3 db/photos.db
```
## Re-populate the table
```bash
cat faces.dump | sqlite3 db/photos.db
```