function createTestModels() {
    const Book = class BookModel extends Model {
        static get fields() {
            return {
                id: attr(),
                name: attr(),
                releaseYear: attr(),
                author: fk("Author", "books"),
                cover: oneToOne("Cover"),
                genres: many("Genre", "books"),
                tags: many("Tag", "books"),
                publisher: fk("Publisher", "books"),
            };
        }
    };
    Book.modelName = "Book";

    const Author = class AuthorModel extends Model {
        static get fields() {
            return {
                id: attr(),
                name: attr(),
                publishers: many({
                    to: "Publisher",
                    through: "Book",
                    relatedName: "authors",
                }),
            };
        }
    };
    Author.modelName = "Author";

    const Cover = class CoverModel extends Model {};
    Cover.modelName = "Cover";
    Cover.fields = {
        id: attr(),
        src: attr(),
    };

    const Genre = class GenreModel extends Model {};
    Genre.modelName = "Genre";
    Genre.fields = {
        id: attr(),
        name: attr(),
    };

    const Tag = class TagModel extends Model {};
    Tag.modelName = "Tag";
    Tag.options = {
        idAttribute: "name",
    };
    Tag.fields = {
        name: attr(),
        subTags: many("this", "parentTags"),
        // TODO: bidirectional many-to-many relations
        // synonymousTags: many('Tag', 'synonymousTags'),
    };

    const Publisher = class PublisherModel extends Model {};
    Publisher.modelName = "Publisher";
    Publisher.fields = {
        id: attr(),
        name: attr(),
    };

    const Movie = class MovieModel extends Model {};
    Movie.modelName = "Movie";
    Movie.fields = {
        id: attr(),
        name: attr(),
        rating: attr(),
        hasPremiered: attr(),
        characters: attr(),
        meta: attr(),
        publisherId: fk({
            to: "Publisher",
            as: "publisher",
            relatedName: "movies",
        }),
    };

    return {
        Book,
        Author,
        Cover,
        Genre,
        Tag,
        Publisher,
        Movie,
    };
}
These utils create a database schema for testing.
The schema is simple but covers most relational
cases: foreign keys, one-to-ones, many-to-many's,
named reverse relations.