Commit graph

161 commits

Author SHA1 Message Date
Alex Cabal
8ad3291a35 Add admin form to view and edit users 2024-11-23 14:30:11 -06:00
Robin Whittleton
ac733df938 New short story in Tanizaki has an additional translator 2024-11-20 11:17:36 -06:00
Alex Cabal
d6a2bdcbc8 Make MARC roles an enum and restructure how contributors are fetched from the DB to reduce queries 2024-11-11 12:01:53 -06:00
Alex Cabal
b3a9d86828 Fix SQL definition 2024-11-11 11:21:21 -06:00
Alex Cabal
ec0b81817d Restructure some files to match new URL structure 2024-11-11 11:17:04 -06:00
Alex Cabal
b340c55460 Move Apache rewrites into separate files 2024-11-11 11:06:04 -06:00
Alex Cabal
acb30b897c Add PropertyFromHttp trait and update codebase to use new pattern 2024-11-10 22:23:43 -06:00
Alex Cabal
c3c588cc1b Add more type hints and work on some code formatting 2024-11-08 14:20:06 -06:00
Alex Cabal
06b82cdaaa Fix broken updated timestamps in OPDS feeds, and fix and add some type hints. 2024-11-08 12:43:47 -06:00
Mike Colagrosso
312e2105ec Change Created datetime to timestamp to match 88c3049 2024-11-04 13:16:56 -06:00
Mike Colagrosso
c3c4cbddca Adopt IF NOT EXISTS approach from 82e43cb 2024-11-04 13:16:56 -06:00
Mike Colagrosso
95a1edc8b7 Bump TocEntries.SortOrder from tinyint to smallint
Ebooks can have more than 255 TocEntries. (572 is the current highest.)
2024-11-04 13:16:56 -06:00
Mike Colagrosso
c8e6524ef2 Remove primary key TocEntryId
Add a SortOrder column to order the TocEntries instead.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
2eb7fef027 Remove primary key GitCommitId
The table already has a Created column, and that's the column we use to sort on.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
3f3cf702b2 Remove primary key ContributorId
`Ebook` to `Contributor` is one to many, and we don't query by ContributorId.
The table already has a SortOrder column, and we use that to order the queries.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
1076c9a77d Remove primary key EbookSourceId
There is a one to many relationship between `Ebook` and `EbookSource`, and we
don't query by `EbookSourceId`. We add a `SortOrder` column to keep the sources
in the same order as specified in `content.opf`.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
4e8ba5ddaa Remove primary key EbookTagId
Add a SortOrder column so that tags are presented in the same order as listed in content.opf.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
b4b6fde778 Remove primary key EbookLocSubjectId
Add a SortOrder column to keep the LocSubjects in the same order as given in content.opf.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
cada95383f Remove primary key CollectionEbookId
Add a SortOrder to preserve the order of the collections listed in content.opf for ebook.php, e.g., for To the Lighthouse:

№ 15 in the Modern Library’s 100 Best Novels set.
Part of the Encyclopædia Britannica’s Great Books of the Western World set.
№ 2 in the BBC’s 100 Greatest British Novels (2015) set.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
783a41a1ba Make Ebook Language NOT NULL 2024-11-04 13:16:56 -06:00
Mike Colagrosso
7d8cfd351e Ebook tags: Store UrlName so it can be queried 2024-11-04 13:16:56 -06:00
Mike Colagrosso
b792dec9e5 Make collection type (series, set) an enum 2024-11-04 13:16:56 -06:00
Mike Colagrosso
a9a0782946 Timestamps: Set DEFAULT and ON UPDATE values
Newer versions of MariaDB, such as this one included with Ubuntu 24.04:

    Server version: 10.11.8-MariaDB-0ubuntu0.24.04.1 Ubuntu 24.04

change the default behavior to not automatically set timestamp defaults and on update values:

    $ mysqld --verbose --help | grep explicit-defaults-for-timestamp
    explicit-defaults-for-timestamp                              TRUE

whereas my older machines allowed it:

    $ mysqld --verbose --help | grep explicit-defaults-for-timestamp
    explicit-defaults-for-timestamp                              FALSE

More background on the flag here:

    https://dev.mysql.com/doc/refman/8.4/en/timestamp-initialization.html
2024-11-04 13:16:56 -06:00
Mike Colagrosso
4abf6e29d2 Add an index for EbookCreated
This is the default sort on /ebooks, so it should have an index
2024-11-04 13:16:56 -06:00
Mike Colagrosso
402dae95ff Add a Type enum to Tags for artwork/ebook 2024-11-04 13:16:56 -06:00
Mike Colagrosso
a25660bc8b Split Collections into two tables 2024-11-04 13:16:56 -06:00
Mike Colagrosso
ac7db8d375 Add primary keys to LocSubjects and Tags tables
Missed these before, and in addition to being a good practice, they are needed to maintain insertion order of LocSubjects and Tags.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
79daa82bf4 Add primary keys to multiple tables
I missed these keys when creating the initial schema, and it's a useful practice.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
7350891cd5 Spell out EbookSourceType values 2024-11-04 13:16:56 -06:00
Mike Colagrosso
88b3ffd9ed Store EbookSourceType as a string/enum, not int 2024-11-04 13:16:56 -06:00
Mike Colagrosso
073f138c47 Initial Ebook DB schema 2024-11-04 13:16:56 -06:00
Alex Cabal
88c3049d7a Change some datetime columns to timestamp 2024-10-24 16:37:09 -05:00
Alex Cabal
82e43cb520 Add DB setup to readme 2024-10-23 11:09:16 -05:00
Alex Cabal
b6fbcaba26 Remove irrelevant user from SQL config 2024-10-22 22:47:56 -05:00
Alex Cabal
19cf14c1aa Add automatic donation drives 2024-10-17 11:58:25 -05:00
Alex Cabal
c40c60d606 Style tweak in PHPStan config file 2024-05-26 13:15:54 -05:00
Alex Cabal
f28378de37 Update SQL table definitions 2024-05-24 11:50:04 -05:00
Alex Cabal
3c54255775 Rename internal PHP config variable 2024-05-14 15:47:29 -05:00
Alex Cabal
70ae877dd8 Bump PHPStan check level to max and add final round of type hints 2024-05-13 10:48:05 -05:00
Alex Cabal
ee7c8343dd Convert some constants to enums 2024-05-11 21:51:06 -05:00
Alex Cabal
703e1a7a03 Continue improving type hints 2024-05-10 23:38:57 -05:00
Alex Cabal
c4c8e7353f Enable strict exception type hint checking in PHPStan and add exception type hints 2024-05-10 20:47:36 -05:00
Alex Cabal
113cc4a541 Add se-vcs-bot user to database permissions 2024-05-02 13:43:42 -05:00
Alex Cabal
5b3f8f7b77 Add support for filling backed enum types in the DB ORM layer, and cleanup some formatting issues 2024-04-25 11:57:02 -05:00
Alex Cabal
219247e16d Increase max file upload size in artwork DB 2024-04-19 13:31:28 -05:00
Alex Cabal
d7e3e648ef Fix MariaDB user config SQL 2024-03-16 12:20:06 -05:00
Alex Cabal
14d6719960 Update DB permissions for SE user 2024-03-07 11:04:05 -06:00
Alex Cabal
307125d71c Add hotlink protection for some naughty hotlinkers 2024-02-28 09:00:30 -06:00
Alex Cabal
9437beaee9 Add thank-you page to ebook downloads 2024-02-26 13:34:44 -06:00
Alex Cabal
8519938e27 Fix SQL in Polls table 2024-02-06 15:53:52 -06:00