Commit graph

17 commits

Author SHA1 Message Date
b04f93db19 Delete old_inits, let's always inline from now on.
The Regenerator class should help with the bulk table rebuilding
that the old inits was added for.
2021-01-01 17:02:03 -08:00
6522bda09c Add basename in separate column so we can orderby it.
For a while I've wanted to be able to sort search results by the file's
basename. This is especially important for the cli. SQLite doesn't have
an easy way to split the filepath column by the slash, so the only
choice is to store basename as a separate column. I put it off for a
while but I think it's the right move. However we must not forget to
update it every time we update filepath, which is a bummer.
2021-01-01 17:02:00 -08:00
f9dc720ff8 Add Regenerator to rebuild tables after breaking changes.
See code comments. The problem is that since I always write the
newest upgrader and use it immediately, I've never actually taken
a very old database and run it through the whole series of
upgraders. So that will be necessary to have more confidence in this
system.
2021-01-01 17:01:59 -08:00
adb1d0ef39 Replace all double blank lines with single, improve hash headers.
There was always some semblance that two blank lines has some kind of
meaning or structure that's different from single blank lines, but
in reality it was mostly arbitrary and I can't stand to look at it
any more.
2020-09-19 03:13:23 -07:00
c91888a738 Some linting. 2020-09-15 19:47:07 -07:00
9578dc4d67 Add column for photo's st_dev, st_ino to facilitate lost&found. 2020-09-15 14:56:45 -07:00
5f9627da61 Remove all cur, just use photodb.sql_execute. 2020-09-15 14:54:44 -07:00
2d5fb19ce7 Remove automatic BEGIN because it breaks pragma foreign_keys.
It turns out you can't adjust foreign_keys while a transaction is active,
so the upgraders that need to disable and re-enable them were not
working right and encountering foreign key violations.
2020-09-15 14:54:21 -07:00
0a608bcb69 In database_upgrader, use DROP INDEX IF EXISTS. 2020-09-11 16:15:42 -07:00
03ae8325c9 Use same transactional try-except-else as YCDL. 2020-08-10 18:50:54 -07:00
9d620b4b97 Remove unused imports & other small things. 2020-02-20 22:44:56 -08:00
851ab2d4cc main should return the args.func(args) value. 2020-02-08 17:24:57 -08:00
4434517c54 Rename config user.min_length -> min_username_length. 2018-04-15 14:36:07 -07:00
21bd211889 Give Users a display_name. 2018-04-15 14:23:24 -07:00
1e42f1ea4e DB V12: Add (photoid, tagid) index to photo_tag_rel. 2018-03-21 19:00:13 -07:00
dffde094e8 Give Albums and Tags an author_id column.
Keeping V11 because I hadn't published previous commits yet.
2018-03-18 15:28:26 -07:00
cc98cf5407 Create subdirs for utilities. 2018-03-18 00:26:57 -07:00