Application/Database design where two tables have both 1-to-many and 1-to-1 relationships

I have an application where the requirements are to show a list of (just for example) car manufacturers. When you click on one of the manufacturers, a list of car models show up. You can then click on the car model to show other data related to the model.

My problem is that one of the manufacturers is to be treated as a car model. There will be only one car model under this manufacturer. The below is an example of the current database structure. As you can see, there is a MegaCar manufacturer and there is only one model under this manufacturer (with the same name). When you click on the MegaCar manufacturer, it should directly load the MegaCar model instead of showing the list of models.

+---------------+ | manufacturers | +---------------+ | id  | name    | +-----+---------+ | 1   | Ford    | +-----+---------+ | 2   | Toyota  | +-----+---------+ | 3   | MegaCar | +-----+---------+  +--------------------------------+ | models                         | +--------------------------------+ | id | manufacturer_id | name    | +----+-----------------+---------+ | 1  | 1               | Focus   | +----+-----------------+---------+ | 2  | 1               | Mustang | +----+-----------------+---------+ | 3  | 2               | Camry   | +----+-----------------+---------+ | 4  | 2               | Corolla | +----+-----------------+---------+ | 5  | 3               | MegaCar | +----+-----------------+---------+ 

I’m trying to decide on a database design and application design to represent this relationship. Basically when someone clicks on the manufacturer MegaCar, I will need to load the model page for MegaCar (where models.id=5), not the manufacturer page (where manufacturers.id=3). I will need to update the database schema for this. My current line of thinking is to add a isModel flag to the manufacturers table and my code would look something like this:

object = getSelectedManufacturer(); if (object.isModel) {     singleModel = query('         SELECT models.id FROM models          INNER JOIN manufacturers ON models.manufacturers_id = manufacturers.id         WHERE manufacturers.id = [object.id]         LIMIT 1     ')     renderModelPage(singleModel) } else {     listOfModels = query('         SELECT * FROM models          WHERE models.manufacturer_id = [object.id]     ')     renderManufacturerPage(listOfModels) // model list page } 

The problem I have with this is it might be confusing to other people who see my code. Also it seems wrong that the relationship between these tables is one-to-many, but I’m making an exception for one record.

I had another idea to add a nullable modelId column to the manufacturers table, but I didn’t like this for the same reason as above. Also, I’ve seen some Q&As around here advising against using NULLs.

What would be the proper way to design this application?