Difference between revisions of "Database"

From MythTV Official Wiki
Jump to: navigation, search
Line 11: Line 11:
 
| align="center" style="background:#f0f0f0;"|'''Table name'''
 
| align="center" style="background:#f0f0f0;"|'''Table name'''
 
| align="center" style="background:#f0f0f0;"|'''Purpose'''
 
| align="center" style="background:#f0f0f0;"|'''Purpose'''
 +
| align="center" style="background:#f0f0f0;"|'''Doxygen docs'''
 
| align="center" style="background:#f0f0f0;"|'''Fields'''
 
| align="center" style="background:#f0f0f0;"|'''Fields'''
 
| align="center" style="background:#f0f0f0;"|'''Key relationship fields'''
 
| align="center" style="background:#f0f0f0;"|'''Key relationship fields'''
 
| align="center" style="background:#f0f0f0;"|'''Other notable fields'''
 
| align="center" style="background:#f0f0f0;"|'''Other notable fields'''
 
|-
 
|-
| [[archiveitems table|archiveitems]]||||||||
+
| [[archiveitems table|archiveitems]]||||||||||
 
|-
 
|-
| [[callsignnetworkmap table|callsignnetworkmap]]||||||||
+
| [[callsignnetworkmap table|callsignnetworkmap]]||||||||||
 
|-
 
|-
| [[capturecard table|capturecard]]||Attributes of capture card||26||cardid*,diseqid||videodevice,audiodevice,cardtype
+
| [[capturecard table|capturecard]]||Attributes of capture card||[http://code.mythtv.org/doxygen/group__db__schema.html#capturecard_table]||26||cardid*,diseqid||videodevice,audiodevice,cardtype
 
|-
 
|-
| [[cardinput table|cardinput]]||||||||
+
| [[cardinput table|cardinput]]||||||||||
 
|-
 
|-
| [[channel table|channel]]||||28||channelid*, freqid, sourceid, xmltvid, mplexid, iptvid||name, channelnum, icon, recpriority, contrast
+
| [[channel table|channel]]||||[http://code.mythtv.org/doxygen/group__db__schema.html#channel_table]||28||channelid*, freqid, sourceid, xmltvid, mplexid, iptvid||name, channelnum, icon, recpriority, contrast
 
|-
 
|-
| [[channelgroup table|channelgroup]]||||3||id*, chanid, grpid||
+
| [[channelgroup table|channelgroup]]||||||3||id*, chanid, grpid||
 
|-
 
|-
| [[channelgroupnames table|channelgroupnames]]||||2||grpid*||
+
| [[channelgroupnames table|channelgroupnames]]||||||2||grpid*||
 
|-
 
|-
| [[channelscan table|channelscan]]||||5||scanid*,cardid,sourceid||processed, scandate
+
| [[channelscan table|channelscan]]||||||5||scanid*,cardid,sourceid||processed, scandate
 
|-
 
|-
| [[channelscan_channel table|channelscan_channel]]||||38||transportid,scanid,mplex_id,source_id,service_id, xmltvid||freqid, service_name, chan_num
+
| [[channelscan_channel table|channelscan_channel]]||||||38||transportid,scanid,mplex_id,source_id,service_id, xmltvid||freqid, service_name, chan_num
 
|-
 
|-
| [[channelscan_dtv_multiplex table|channelscan_dtv_multiplex]]||||||||
+
| [[channelscan_dtv_multiplex table|channelscan_dtv_multiplex]]||||||||||
 
|-
 
|-
| [[codecparams table|codecparams]]||||||||
+
| [[codecparams table|codecparams]]||||||||||
 
|-
 
|-
| [[credits table|credits]]||||||||
+
| [[credits table|credits]]||||||||||
 
|-
 
|-
| [[customexample table|customexample]]||||||||
+
| [[customexample table|customexample]]||||||||||
 
|-
 
|-
| [[diseqc_config table|diseqc_config]]||||||||
+
| [[diseqc_config table|diseqc_config]]||||||||||
 
|-
 
|-
| [[diseqc_tree table|diseqc_tree]]||||||||
+
| [[diseqc_tree table|diseqc_tree]]||||||||||
 
|-
 
|-
| [[displayprofilegroups table|displayprofilegroups]]||||||||
+
| [[displayprofilegroups table|displayprofilegroups]]||||||||||
 
|-
 
|-
| [[displayprofiles table|displayprofiles]]||||||||
+
| [[displayprofiles table|displayprofiles]]||||||||||
 
|-
 
|-
| [[dtv_multiplex table|dtv_multiplex]]||Information needed to tue to a particular frequency on a particular input||24||mplexid*,sourceid,transportid,networkid||frequency, polarity, modulation
+
| [[dtv_multiplex table|dtv_multiplex]]||Information needed to tue to a particular frequency on a particular input||[http://code.mythtv.org/doxygen/group__db__schema.html#dtv_multiplex_table]||24||mplexid*,sourceid,transportid,networkid||frequency, polarity, modulation
 
|-
 
|-
| [[dtv_privatetypes table|dtv_privatetypes]]||Free form data pertaining to DVB services, it is like a settings table for DVB.||4||networkid||sitype,private_type,private_value
+
| [[dtv_privatetypes table|dtv_privatetypes]]||Free form data pertaining to DVB services, it is like a settings table for DVB.||[http://code.mythtv.org/doxygen/group__db__schema.html#dtv_privatetypes_table]||4||networkid||sitype,private_type,private_value
 
|-
 
|-
| [[dvdbookmark table|dvdbookmark]]||||||||
+
| [[dvdbookmark table|dvdbookmark]]||||||||||
 
|-
 
|-
| [[dvdinput table|dvdinput]]||||||||
+
| [[dvdinput table|dvdinput]]||||||||||
 
|-
 
|-
| [[dvdtranscode table|dvdtranscode]]||||||||
+
| [[dvdtranscode table|dvdtranscode]]||||||||||
 
|-
 
|-
| [[eit_cache table|eit_cache]]||||||||
+
| [[eit_cache table|eit_cache]]||||||||||
 
|-
 
|-
| [[filemarkup table|filemarkup]]||||||||
+
| [[filemarkup table|filemarkup]]||||||||||
 
|-
 
|-
| [[gallerymetadata table|gallerymetadata]]||||||||
+
| [[gallerymetadata table|gallerymetadata]]||||||||||
 
|-
 
|-
| [[gamemetadata table|gamemetadata]]||||||||
+
| [[gamemetadata table|gamemetadata]]||||||||||
 
|-
 
|-
| [[gameplayers table|gameplayers]]||||||||
+
| [[gameplayers table|gameplayers]]||||||||||
 
|-
 
|-
| [[housekeeping table|housekeeping]]||||||||
+
| [[housekeeping table|housekeeping]]||||||||||
 
|-
 
|-
| [[inputgroup table|inputgroup]]||||||||
+
| [[inputgroup table|inputgroup]]||||||||||
 
|-
 
|-
| [[internetcontent table|internetcontent]]||||||||
+
| [[internetcontent table|internetcontent]]||||||||||
 
|-
 
|-
| [[internetcontentarticles table|internetcontentarticles]]||||||||
+
| [[internetcontentarticles table|internetcontentarticles]]||||||||||
 
|-
 
|-
| [[inuseprograms table|inuseprograms]]||||||||
+
| [[inuseprograms table|inuseprograms]]||||||||||
 
|-
 
|-
| [[iptv_channel table|iptv_channel]]||||||||
+
| [[iptv_channel table|iptv_channel]]||||||||||
 
|-
 
|-
| [[jobqueue table|jobqueue]]||||||||
+
| [[jobqueue table|jobqueue]]||||||||||
 
|-
 
|-
| [[jumppoints table|jumppoints]]||||||||
+
| [[jumppoints table|jumppoints]]||||||||||
 
|-
 
|-
| [[keybindings table|keybindings]]||||||||
+
| [[keybindings table|keybindings]]||||||||||
 
|-
 
|-
| [[keyword table|keyword]]||||||||
+
| [[keyword table|keyword]]||||||||||
 
|-
 
|-
| [[livestream table|livestream]]||||||||
+
| [[livestream table|livestream]]||||||||||
 
|-
 
|-
| [[logging table|logging]]||||||||
+
| [[logging table|logging]]||||||||||
 
|-
 
|-
| [[movies_movies table|movies_movies]]||||||||
+
| [[movies_movies table|movies_movies]]||||||||||
 
|-
 
|-
| [[movies_showtimes table|movies_showtimes]]||||||||
+
| [[movies_showtimes table|movies_showtimes]]||||||||||
 
|-
 
|-
| [[movies_theaters table|movies_theaters]]||||||||
+
| [[movies_theaters table|movies_theaters]]||||||||||
 
|-
 
|-
| [[music_albumart table|music_albumart]]||||||||
+
| [[music_albumart table|music_albumart]]||||||||||
 
|-
 
|-
| [[music_albums table|music_albums]]||||||||
+
| [[music_albums table|music_albums]]||||||||||
 
|-
 
|-
| [[music_artists table|music_artists]]||||||||
+
| [[music_artists table|music_artists]]||||||||||
 
|-
 
|-
| [[music_directories table|music_directories]]||||||||
+
| [[music_directories table|music_directories]]||||||||||
 
|-
 
|-
| [[music_genres table|music_genres]]||||||||
+
| [[music_genres table|music_genres]]||||||||||
 
|-
 
|-
| [[music_playlists table|music_playlists]]||||||||
+
| [[music_playlists table|music_playlists]]||||||||||
 
|-
 
|-
| [[music_smartplaylists table|music_smartplaylists]]||||||||
+
| [[music_smartplaylists table|music_smartplaylists]]||||||||||
 
|-
 
|-
| [[music_smartplaylist_categories table|music_smartplaylist_categories]]||||||||
+
| [[music_smartplaylist_categories table|music_smartplaylist_categories]]||||||||||
 
|-
 
|-
| [[music_smartplaylist_items table|music_smartplaylist_items]]||||||||
+
| [[music_smartplaylist_items table|music_smartplaylist_items]]||||||||||
 
|-
 
|-
| [[music_songs table|music_songs]]||||||||
+
| [[music_songs table|music_songs]]||||||||||
 
|-
 
|-
| [[music_stats table|music_stats]]||||||||
+
| [[music_stats table|music_stats]]||||||||||
 
|-
 
|-
| [[mythlog table|mythlog]]||||||||
+
| [[mythlog table|mythlog]]||||||||||
 
|-
 
|-
| [[networkiconmap table|networkiconmap]]||||||||
+
| [[networkiconmap table|networkiconmap]]||||||||||
 
|-
 
|-
| [[newssites table|newssites]]||||||||
+
| [[newssites table|newssites]]||||||||||
 
|-
 
|-
| [[oldfind table|oldfind]]||||||||
+
| [[oldfind table|oldfind]]||||[http://code.mythtv.org/doxygen/group__db__schema.html#oldfind_table]||||||
 
|-
 
|-
| [[oldprogram table|oldprogram]]||||||||
+
| [[oldprogram table|oldprogram]]||||||||||
 
|-
 
|-
| [[oldrecorded table|oldrecorded]]||||||||
+
| [[oldrecorded table|oldrecorded]]||||[http://code.mythtv.org/doxygen/group__db__schema.html#oldrecorded_table]||||||
 
|-
 
|-
| [[people table|people]]||||||||
+
| [[people table|people]]||||||||||
 
|-
 
|-
| [[phonecallhistory table|phonecallhistory]]||||||||
+
| [[phonecallhistory table|phonecallhistory]]||||||||||
 
|-
 
|-
| [[phonedirectory table|phonedirectory]]||||||||
+
| [[phonedirectory table|phonedirectory]]||||||||||
 
|-
 
|-
| [[pidcache table|pidcache]]||||||||
+
| [[pidcache table|pidcache]]||||||||||
 
|-
 
|-
| [[playgroup table|playgroup]]||||||||
+
| [[playgroup table|playgroup]]||||||||||
 
|-
 
|-
| [[powerpriority table|powerpriority]]||||||||
+
| [[powerpriority table|powerpriority]]||||||||||
 
|-
 
|-
| [[profilegroups table|profilegroups]]||||||||
+
| [[profilegroups table|profilegroups]]||||||||||
 
|-
 
|-
| [[program table|program]]||||||||
+
| [[program table|program]]||||[http://code.mythtv.org/doxygen/group__db__schema.html#program_table]||||||
 
|-
 
|-
| [[programgenres table|programgenres]]||||||||
+
| [[programgenres table|programgenres]]||||||||||
 
|-
 
|-
| [[programrating table|programrating]]||||||||
+
| [[programrating table|programrating]]||||||||||
 
|-
 
|-
| [[recgrouppassword table|recgrouppassword]]||||||||
+
| [[recgrouppassword table|recgrouppassword]]||||||||||
 
|-
 
|-
| [[record table|record]]||||||||
+
| [[record table|record]]||||||||||
 
|-
 
|-
| [[recorded table|recorded]]||||||||
+
| [[recorded table|recorded]]||||[http://code.mythtv.org/doxygen/group__db__schema.html#recorded_table]||||||
 
|-
 
|-
| [[recordedartwork table|recordedartwork]]||||||||
+
| [[recordedartwork table|recordedartwork]]||||||||||
 
|-
 
|-
| [[recordedcredits table|recordedcredits]]||||||||
+
| [[recordedcredits table|recordedcredits]]||||||||||
 
|-
 
|-
| [[recordedfile table|recordedfile]]||||||||
+
| [[recordedfile table|recordedfile]]||||||||||
 
|-
 
|-
| [[recordedmarkup table|recordedmarkup]]||||||||
+
| [[recordedmarkup table|recordedmarkup]]||||||||||
 
|-
 
|-
| [[recordedprogram table|recordedprogram]]||||||||
+
| [[recordedprogram table|recordedprogram]]||||||||||
 
|-
 
|-
| [[recordedrating table|recordedrating]]||||||||
+
| [[recordedrating table|recordedrating]]||||||||||
 
|-
 
|-
| [[recordedseek table|recordedseek]]||||||||
+
| [[recordedseek table|recordedseek]]||||||||||
 
|-
 
|-
| [[recordfilter table|recordfilter]]||||||||
+
| [[recordfilter table|recordfilter]]||||||||||
 
|-
 
|-
| [[recordingprofiles table|recordingprofiles]]||||||||
+
| [[recordingprofiles table|recordingprofiles]]||||||||||
 
|-
 
|-
| [[recordmatch table|recordmatch]]||||||||
+
| [[recordmatch table|recordmatch]]||||||||||
 
|-
 
|-
| [[romdb table|romdb]]||||||||
+
| [[romdb table|romdb]]||||||||||
 
|-
 
|-
| [[scannerfile table|scannerfile]]||||||||
+
| [[scannerfile table|scannerfile]]||||||||||
 
|-
 
|-
| [[scannerpath table|scannerpath]]||||||||
+
| [[scannerpath table|scannerpath]]||||||||||
 
|-
 
|-
| [[schemalock table|schemalock]]||||||||
+
| [[schemalock table|schemalock]]||||||||||
 
|-
 
|-
| [[settings table|settings]]||||||||
+
| [[settings table|settings]]||||||||||
 
|-
 
|-
| [[storagegroup table|storagegroup]]||||||||
+
| [[storagegroup table|storagegroup]]||||||||||
 
|-
 
|-
| [[tvchain table|tvchain]]||||||||
+
| [[tvchain table|tvchain]]||||||||||
 
|-
 
|-
| [[tvosdmenu table|tvosdmenu]]||||||||
+
| [[tvosdmenu table|tvosdmenu]]||||||||||
 
|-
 
|-
| [[upnpmedia table|upnpmedia]]||||||||
+
| [[upnpmedia table|upnpmedia]]||||||||||
 
|-
 
|-
| [[videocast table|videocast]]||||||||
+
| [[videocast table|videocast]]||||||||||
 
|-
 
|-
| [[videocategory table|videocategory]]||||||||
+
| [[videocategory table|videocategory]]||||||||||
 
|-
 
|-
| [[videocollection table|videocollection]]||||||||
+
| [[videocollection table|videocollection]]||||||||||
 
|-
 
|-
| [[videocountry table|videocountry]]||||||||
+
| [[videocountry table|videocountry]]||||||||||
 
|-
 
|-
| [[videogenre table|videogenre]]||||||||
+
| [[videogenre table|videogenre]]||||||||||
 
|-
 
|-
| [[videometadata table|videometadata]]||||||||
+
| [[videometadata table|videometadata]]||||||||||
 
|-
 
|-
| [[videometadatacast table|videometadatacast]]||||||||
+
| [[videometadatacast table|videometadatacast]]||||||||||
 
|-
 
|-
| [[videometadatacountry table|videometadatacountry]]||||||||
+
| [[videometadatacountry table|videometadatacountry]]||||||||||
 
|-
 
|-
| [[videometadatagenre table|videometadatagenre]]||||||||
+
| [[videometadatagenre table|videometadatagenre]]||||||||||
 
|-
 
|-
| [[videopart table|videopart]]||||||||
+
| [[videopart table|videopart]]||||||||||
 
|-
 
|-
| [[videopathinfo table|videopathinfo]]||||||||
+
| [[videopathinfo table|videopathinfo]]||||||||||
 
|-
 
|-
| [[videosource table|videosource]]||This table tells us about a particular input on a video capture card.||||||
+
| [[videosource table|videosource]]||This table tells us about a particular input on a video capture card.||[http://code.mythtv.org/doxygen/group__db__schema.html#videosource_table]||||||
 
|-
 
|-
| [[videotypes table|videotypes]]||||||||
+
| [[videotypes table|videotypes]]||||||||||
 
|-
 
|-
| [[weatherdatalayout table|weatherdatalayout]]||||||||
+
| [[weatherdatalayout table|weatherdatalayout]]||||||||||
 
|-
 
|-
| [[weatherscreens table|weatherscreens]]||||||||
+
| [[weatherscreens table|weatherscreens]]||||||||||
 
|-
 
|-
| [[weathersourcesettings table|weathersourcesettings]]||||||||
+
| [[weathersourcesettings table|weathersourcesettings]]||||||||||
 
|-
 
|-
| [[websites table|websites]]||||||||
+
| [[websites table|websites]]||||||||||
 
|}
 
|}
  

Revision as of 11:39, 14 February 2013

MythTV uses a MySQL [relational database] to manage almost all aspects of configuration and day-to-day operation. Mythfrontend, mythbackend, mythfilldatabase, MythTV plugins and ancillary programs all interact with the database and use it to store settings and information.

By default, the database is named mythconverg and contains a set of tables that interact with one-another. When running multiple frontends and/or backends, only one database is required.

Database tables

In 0.26 there are 108 tables in the database. The incomplete schema below gives some information about what each table is for and some of the key fields.

Information on the 0.27 database schema generated by Doxygen is available here on the MythTV code development site.

Table name Purpose Doxygen docs Fields Key relationship fields Other notable fields
archiveitems
callsignnetworkmap
capturecard Attributes of capture card [1] 26 cardid*,diseqid videodevice,audiodevice,cardtype
cardinput
channel [2] 28 channelid*, freqid, sourceid, xmltvid, mplexid, iptvid name, channelnum, icon, recpriority, contrast
channelgroup 3 id*, chanid, grpid
channelgroupnames 2 grpid*
channelscan 5 scanid*,cardid,sourceid processed, scandate
channelscan_channel 38 transportid,scanid,mplex_id,source_id,service_id, xmltvid freqid, service_name, chan_num
channelscan_dtv_multiplex
codecparams
credits
customexample
diseqc_config
diseqc_tree
displayprofilegroups
displayprofiles
dtv_multiplex Information needed to tue to a particular frequency on a particular input [3] 24 mplexid*,sourceid,transportid,networkid frequency, polarity, modulation
dtv_privatetypes Free form data pertaining to DVB services, it is like a settings table for DVB. [4] 4 networkid sitype,private_type,private_value
dvdbookmark
dvdinput
dvdtranscode
eit_cache
filemarkup
gallerymetadata
gamemetadata
gameplayers
housekeeping
inputgroup
internetcontent
internetcontentarticles
inuseprograms
iptv_channel
jobqueue
jumppoints
keybindings
keyword
livestream
logging
movies_movies
movies_showtimes
movies_theaters
music_albumart
music_albums
music_artists
music_directories
music_genres
music_playlists
music_smartplaylists
music_smartplaylist_categories
music_smartplaylist_items
music_songs
music_stats
mythlog
networkiconmap
newssites
oldfind [5]
oldprogram
oldrecorded [6]
people
phonecallhistory
phonedirectory
pidcache
playgroup
powerpriority
profilegroups
program [7]
programgenres
programrating
recgrouppassword
record
recorded [8]
recordedartwork
recordedcredits
recordedfile
recordedmarkup
recordedprogram
recordedrating
recordedseek
recordfilter
recordingprofiles
recordmatch
romdb
scannerfile
scannerpath
schemalock
settings
storagegroup
tvchain
tvosdmenu
upnpmedia
videocast
videocategory
videocollection
videocountry
videogenre
videometadata
videometadatacast
videometadatacountry
videometadatagenre
videopart
videopathinfo
videosource This table tells us about a particular input on a video capture card. [9]
videotypes
weatherdatalayout
weatherscreens
weathersourcesettings
websites

Command line interface

Use the mysql command on the host running the database:

% mysql -u mythtv -pmythtv mythconverg

SQL commands can be issued at the mysql> prompt.

Graphical interface

Try installing phpMyAdmin, which can administrate MySQL databases via a browser.