Difference between revisions of "Storagegroup table"

From MythTV Official Wiki
Jump to: navigation, search
 
m
 
(6 intermediate revisions by 2 users not shown)
Line 29: Line 29:
 
</pre>
 
</pre>
  
 +
Commonly used groupname field values
 +
<pre>
 +
Default
 +
Videos
 +
Fanart
 +
Trailers
 +
Coverart
 +
Screenshots
 +
Banners
 +
DB Backups
 +
LiveTV
 +
Streaming
 +
</pre>
 +
 +
On a new install, the table is empty.
 +
 +
== SQL ==
 +
 +
If you want to add another block of entries, because say you have another volume with storage, use this sql. 
 +
The id column is left out because it auto-increments during the insert.
 +
phpmyadmin is an easy to use tool for applying sql.
 +
 +
Check your sql has the intended result first
 +
<pre>
 +
SELECT groupname,hostname,concat('/srv/',substring(dirname,10)) AS newdirname FROM storagegroup;
 +
</pre>
 +
 +
Then apply the block copy
 +
<pre>
 +
INSERT INTO storagegroup (groupname,hostname,dirname)
 +
  SELECT groupname,hostname,concat('/srv/',substring(dirname,10)) AS newdirname FROM storagegroup;
 +
</pre>
 +
10 rows inserted.
 +
 +
If you need to amend your hostname, or insert a storagegroup block from another backend
 +
<pre>
 +
UPDATE storagegroup SET hostname='localhost';
 +
</pre>
 +
 +
See also [[Storage_Groups]] for how these entries are used.
 +
 +
== Default ==
 +
 +
If you screw up your storagegroup table, or just want to reset it to default
 +
 +
Clear out the mess first
 +
<pre>
 +
TRUNCATE TABLE storagegroup;
 +
</pre>
  
{{stub}}
 
 
[[Category:DB Table]]
 
[[Category:DB Table]]

Latest revision as of 21:25, 9 February 2014

Important.png Note: The correct title of this article is storagegroup table. It appears incorrectly here due to technical restrictions.

The storagegroup table contains the Storage Groups that are configured in mythtv-setup.

Table Description

Field name Type Null Key Default Extras
id int(11) PRI NULL auto_increment
groupname varchar(32) MUL NULL
hostname varchar(64) MUL NULL
dirname varchar(255) NULL

Fields

  • id is a unique identifier for entries in this table.
  • groupname is the name of the Storage Group.
  • dirname is the directory of the Storage Group.

Example Entries

       id: 1
groupname: Default
 hostname: localhost.localdomain
  dirname: /video/recordings/ 

Commonly used groupname field values

Default
Videos
Fanart
Trailers
Coverart
Screenshots
Banners
DB Backups
LiveTV
Streaming

On a new install, the table is empty.

SQL

If you want to add another block of entries, because say you have another volume with storage, use this sql. The id column is left out because it auto-increments during the insert. phpmyadmin is an easy to use tool for applying sql.

Check your sql has the intended result first

SELECT groupname,hostname,concat('/srv/',substring(dirname,10)) AS newdirname FROM storagegroup;

Then apply the block copy

INSERT INTO storagegroup (groupname,hostname,dirname)
  SELECT groupname,hostname,concat('/srv/',substring(dirname,10)) AS newdirname FROM storagegroup;

10 rows inserted.

If you need to amend your hostname, or insert a storagegroup block from another backend

UPDATE storagegroup SET hostname='localhost';

See also Storage_Groups for how these entries are used.

Default

If you screw up your storagegroup table, or just want to reset it to default

Clear out the mess first

TRUNCATE TABLE storagegroup;