1
Fork 0
Commit Graph

71 Commits

Author SHA1 Message Date
András Maróy dca81c7918 Don't log postgres password when connecting 2021-01-31 18:53:38 +01:00
András Maróy be83849bee Implement postgres support 2021-01-31 17:07:29 +01:00
stz184 8b4e2192c2 Fixes photoview/issues#168
- Removed unnecessary migration.
2021-01-30 17:55:12 +02:00
stz184 f723bda7c5 Fixes photoview/issues#168
- Migrated mediaGeoJson resolver to GORM
- Fixed issue loading media list in MediaList() function
- Fixed typo in the column "gps_lonitude" (renamed to "gps_longitude")
2021-01-29 01:23:40 +02:00
viktorstrate 4bc50583d2
Add db max open connections again 2021-01-19 16:59:10 +01:00
viktorstrate dcca5becb5
Rewrite db retry to reconfigure database on error 2021-01-19 15:49:03 +01:00
viktorstrate 52e8013026
Fix sql compatibility problem when running in Docker 2021-01-17 18:12:32 +01:00
viktorstrate 107da91700
Refactor handling of environment variables 2021-01-17 16:50:48 +01:00
viktorstrate 621ad00fff
Update example.env with sqlite comments 2021-01-17 13:15:41 +01:00
viktorstrate 50d0aa0efb
Disable multithreaded scanners for sqlite
as it's not reliable
2021-01-17 13:08:44 +01:00
viktorstrate fcdb5b4e7b
Work on sqlite support 2021-01-17 12:45:23 +01:00
viktorstrate f711da4d9c
Merge branch 'v2.0.0' into v2/multi-database-support 2021-01-17 12:21:32 +01:00
Vladimir Ivanov 85ce3a1018
Update api/database/database.go
Co-authored-by: Viktor Strate Kløvedal <viktorstrate@gmail.com>
2021-01-16 19:35:02 +02:00
stz184 5b7637cb3c Added db connection retry logic 2021-01-12 20:14:28 +02:00
viktorstrate 41b122c461
Start on sqlite support
- TODO: Sqlite doesn't support MD5, all calls to this function should be done
  beforehand.
2021-01-10 18:59:01 +01:00
viktorstrate 820ae78563
Delete old migrations 2021-01-10 18:29:33 +01:00
viktorstrate 732ccd05ab
restructure user <-> albums relations in database 2020-12-20 17:10:00 +01:00
viktorstrate 907894dda3
Merge branch 'master' into v2.0.0 2020-12-17 23:18:00 +01:00
viktorstrate f0d580116b
Improve album and media resolvers 2020-12-08 16:24:08 +01:00
viktorstrate 98f13d76e6
Replace database, work on scanning 2020-11-30 21:29:49 +01:00
viktorstrate 177ae91500 Replace database, mostly video 2020-11-25 23:06:47 +01:00
viktorstrate 2e9aa29258 Replace database, mostly media related 2020-11-23 20:43:00 +01:00
viktorstrate 3c23f82330 Replace database, mostly album related 2020-11-23 19:59:01 +01:00
viktorstrate 27b2f95a7b Start on migrating database integration to gorm 2020-11-23 19:39:44 +01:00
sean borg 8d2932dc4d Typo fix 2020-11-22 09:22:01 +00:00
sean borg 11d67c9ae9 Add sidecar path & hash to DB 2020-11-21 11:54:01 +00:00
viktorstrate 534b95edcb Set defaults for new migrations,
to ensure updating photoview is seemless
2020-09-25 19:31:35 +02:00
viktorstrate bbff25973e Fix bug where max_concurrent_tasks for...
scanner queue would be initialized to 0.
2020-09-24 17:52:53 +02:00
viktorstrate d09bb3b99e Fix database compatibility issues with arm (#88)
- Change max key-length of username to 128
- Fix minor syntax error
2020-09-23 13:18:46 +02:00
viktorstrate 9c9807ecc9 Add admin setting to change max concurrent workers 2020-09-21 21:32:30 +02:00
viktorstrate 679dc70340 Prepare for periodic scan intervals
Add setting to database, and to graphql api
2020-09-20 22:19:25 +02:00
viktorstrate 78b415871d Add date information to media
This closes #61
2020-08-12 13:04:41 +02:00
viktorstrate 849f2f25bf Add fileSize to media_url database entries 2020-08-11 22:18:15 +02:00
viktorstrate b52595fe46 Save gps coordinates from exif
This closes #62
2020-08-11 14:46:23 +02:00
viktorstrate 91a6b4de08 Merge database migrations...
...in preparation of v1.0.0. This fixes #60
2020-08-11 14:31:04 +02:00
viktorstrate 3e4b232b1e Update migration to support mariadb 10.5.2 and newer
To support the database configuration used in docker-compose.example.yml
2020-07-15 10:45:33 +02:00
viktorstrate 0e9d37ca77 Add video metadata 2020-07-12 14:17:49 +02:00
viktorstrate 9e5480188b add media_type column to media table in database 2020-07-11 14:05:06 +02:00
viktorstrate df80802cab Huge refactor: rename photo to media
To prepare for video support

Migrate database rename tables and columns:
- photo to media
- photo_url to media_url
- photo_exif to media_exif

- Update api accordingly
2020-07-10 14:26:19 +02:00
viktorstrate b4bdd522dc Make sure path hash is added consistently
The path_hash attribute is added after the path attribute,
to make it consistent with `002_photo.up.sql`
2020-06-30 15:53:29 +02:00
viktorstrate f2bcdf883f Update path hash database migrations 2020-06-30 15:35:45 +02:00
stz184 e70da6bb26 Merge remote-tracking branch 'upstream/master' into use-hash-instead-of-full-path-to-avoid-key-length-maximum 2020-06-24 13:42:43 +03:00
stz184 f88fa33e5f InnoDB has a maximum index length of 767 bytes for tables that use COMPACT or REDUNDANT row format, so for utf8mb3 or utf8mb4 columns, you can index a maximum of 255 or 191 characters, respectively.
That's why I created a new column storing a MD5 hash of the path and made it unique. The MD5 hash has only 32 characters and can be generated natively in MySQL and MariaDB. It helps us to avoid maximum key length and in the same time enforce unique photo and album paths.

- Added path_hash column to photo and album tables
- Added down migration file for 005_utf8_migration (just for consistency)
- Added PathHash field to Album and Photo struct
- album_scanner.go and photo_scanner.goo perform checks by MD5 hash now
2020-06-24 11:43:20 +03:00
viktorstrate b289b25e34 Start on photo favorite 2020-06-17 18:00:58 +02:00
viktorstrate deb2fd9f4f Improve mysql connection retry on ping fail 2020-04-30 15:00:18 +02:00
viktorstrate c5dd3debe5 Add missing new dependency + cleanup 2020-04-15 20:52:08 +02:00
Bruno Sousa c64b4d0d39 make SetupDatabase returns an error and use PingContext with timeout 2020-04-15 16:18:51 +02:00
Viktor Strate Kløvedal 8ad1e11015
Sql 4 bytes utf (#17)
Update UTF migration to use 4 bytes unicode
2020-03-13 20:21:49 +01:00
viktorstrate a65a7bc289 Migrate all database tables to use utf8
Before this, photos and albums with special characters,
would result in a scanner error and would not be imported properly.
2020-03-10 19:03:40 +01:00
viktorstrate e0ada51b6b Decrease max open connections to 80 2020-02-29 10:03:56 +01:00