Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.

Commit ab58c1b

Browse files
committed
Merge branch 'master' of github.com:Radarr/RadarrAPI.TMDB
2 parents 65f3985 + 0b2358e commit ab58c1b

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

mappings/brainstorming.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,57 @@
4040
- Disapprove mappinng: 2
4141
- Lock mapping: 3
4242

43+
### Create Syntaxes:
44+
```
45+
-- Create syntax for TABLE 'ip_adresses'
46+
CREATE TABLE `ip_adresses` (
47+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
48+
`ip` varchar(16) NOT NULL DEFAULT '',
49+
`mappingsid` int(11) unsigned NOT NULL,
50+
PRIMARY KEY (`id`),
51+
KEY `FK_mappingsid_ip` (`mappingsid`),
52+
CONSTRAINT `FK_mappingsid_ip` FOREIGN KEY (`mappingsid`) REFERENCES `mappings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
53+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
54+
55+
-- Create syntax for TABLE 'mappings'
56+
CREATE TABLE `mappings` (
57+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
58+
`tmdbid` int(11) NOT NULL,
59+
`imdbid` varchar(9) NOT NULL DEFAULT '',
60+
`report_count` int(11) NOT NULL,
61+
`locked` tinyint(11) NOT NULL DEFAULT '0',
62+
`total_reports` int(11) NOT NULL,
63+
PRIMARY KEY (`id`)
64+
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
65+
66+
-- Create syntax for TABLE 'events'
67+
CREATE TABLE `events` (
68+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
69+
`type` int(11) unsigned NOT NULL,
70+
`mappingsid` int(11) unsigned NOT NULL,
71+
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
72+
PRIMARY KEY (`id`),
73+
KEY `FK_mappings_events` (`mappingsid`),
74+
CONSTRAINT `FK_mappings_events` FOREIGN KEY (`mappingsid`) REFERENCES `mappings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
75+
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
76+
77+
-- Create syntax for TABLE 'title_mappings'
78+
CREATE TABLE `title_mappings` (
79+
`mappingsid` int(11) unsigned NOT NULL,
80+
`aka_title` text NOT NULL,
81+
PRIMARY KEY (`mappingsid`),
82+
CONSTRAINT `FK_mappingsid` FOREIGN KEY (`mappingsid`) REFERENCES `mappings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
83+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
84+
85+
-- Create syntax for TABLE 'year_mappings'
86+
CREATE TABLE `year_mappings` (
87+
`mappingsid` int(11) unsigned NOT NULL,
88+
`aka_year` smallint(4) NOT NULL,
89+
PRIMARY KEY (`mappingsid`),
90+
CONSTRAINT `year_mappings_ibfk_1` FOREIGN KEY (`mappingsid`) REFERENCES `mappings` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
91+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
4392
93+
```
4494
## Possible API
4595

4696
### POST /mappings/add

0 commit comments

Comments
 (0)