feat(journey): optionally place an entry where its first photo was taken (#1003)

This commit is contained in:
Maurice
2026-10-01 14:05:47 +02:00
parent f875c85474
commit 81d7022b96
38 changed files with 322 additions and 16 deletions
+10
View File
@@ -5440,6 +5440,16 @@ function runMigrations(db: Database.Database): void {
if (!has('email')) db.exec('ALTER TABLE places ADD COLUMN email TEXT');
if (!has('opening_hours')) db.exec('ALTER TABLE places ADD COLUMN opening_hours TEXT');
},
/**
* A journey that puts an entry on the map where its first photo was taken
* (#1003). Off unless the owner turns it on: an entry somebody placed by hand
* is never moved, but an entry left without a place on purpose should not
* grow one either just because a picture was added.
*/
() => {
const cols = db.prepare("SELECT name FROM pragma_table_info('journeys')").all() as { name: string }[];
if (!cols.some(c => c.name === 'photo_location')) db.exec('ALTER TABLE journeys ADD COLUMN photo_location INTEGER NOT NULL DEFAULT 0');
},
];
if (currentVersion < migrations.length) {