* Replace `EbookUrl` with `EbookId` in `Artworks`
* Add a `FullUrl` member to `Ebook`
Add documentation about when to use it versus Url.
The full URL is also being used as an ID in RSS feeds, so use `FullUrl` there.
* Store an `EbookId` in `Artworks`
The data in these fields are separate:
* `IndexableText`
* `Title`
* `IndexableAuthors`
* `IndexableCollections`
There are also on indices on each of these fields so that they can have
separate weight in the relevance scoring.
Here's what's in `IndexableText` right now:
1. Title
2. Collections
3. Authors
4. Tags
5. LocSubjects
6. TocEntries
Here is the proposed new ranking:
```
10 * Title +
8 * Authors +
3 * Collections +
IndexableText
```
New indices for existing DBs:
```
ALTER TABLE `Ebooks` ADD COLUMN `IndexableAuthors` text NOT NULL;
ALTER TABLE `Ebooks` ADD COLUMN `IndexableCollections` text NULL;
ALTER TABLE `Ebooks` ADD FULLTEXT `indexSearchTitle` (`Title`);
ALTER TABLE `Ebooks` ADD FULLTEXT `idxSearchAuthors` (`IndexableAuthors`);
ALTER TABLE `Ebooks` ADD FULLTEXT `idxSearchCollections` (`IndexableCollections`);
```
`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.
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`.
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.
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