Location: PHPKode > projects > Axis Groupware > musiclib/setup/tables_baseline.inc.php
<?php
  /**************************************************************************\
  * Axis Groupware                                                           *
  * http://www.axisgroupware.org                                             *
  * --------------------------------------------                             *
  *  This program is free software; you can redistribute it and/or modify it *
  *  under the terms of the GNU General Public License as published by the   *
  *  Free Software Foundation; either version 2 of the License, or (at your  *
  *  option) any later version.                                              *
  \**************************************************************************/

	$phpgw_baseline = array(
		'phpgw_musiclib_artists' => array(
			'fd' => array(
				'id' => array('type' => 'auto', 'nullable' => false),
				'artist_name' => array('type' => 'varchar', 'precision' => 255),
			),
			'pk' => array('id'),
			'fk' => array(),
			'ix' => array(),
			'uc' => array()
		),
		'phpgw_musiclib_albums' => array(
			'fd' => array(
				'id' => array('type' => 'auto', 'nullable' => false),
				'artist_id' => array('type' => 'int', 'precision' => 8),
				'album_title' => array('type' => 'varchar', 'precision' => 255),

				# these will be used to store id3 tag values
				'year' => array('type' => 'int', 'precision' => 4),
				'genre_id' => array('type' => 'int', 'precision' => 8),

				# for personal use
				'comment' => array('type' => 'varchar', 'precision' => 255),

				'times_album_played' => array('type' => 'int', 'precision' => 8, 'default' => 0),
			),
			'pk' => array('id'),
			'fk' => array('artist_id'),
			'ix' => array(),
			'uc' => array()
		),
		'phpgw_musiclib_songs' => array(
			'fd' => array(
				'id' => array('type' => 'auto', 'nullable' => false),
				'artist_id' => array('type' => 'int', 'precision' => 8),
				'album_id' => array('type' => 'int', 'precision' => 8),
				'track' => array('type' => 'varchar', 'precision' => 2),
				'song_title' => array('type' => 'varchar', 'precision' => 255),
				'file_extension' => array('type' => 'varchar', 'precision' => 8),

				# these will be used to store id3 tag values
				'comment' => array('type' => 'text'),
				
				# read from file
				'bitrate' => array('type' => 'varchar', 'precision' => 3),
				'length' => array('type' => 'int', 'precision' => 8), # in seconds
				
				'times_played' => array('type' => 'int', 'precision' => 8, 'default' => 0),
				'random_play' => array('type' => 'int', 'precision' => 2, 'default' => 1)
			),
			'pk' => array('id'),
			'fk' => array('artist_id','album_id'),
			'ix' => array(),
			'uc' => array()
		),
		'phpgw_musiclib_playlists' => array(
			'fd' => array(
				'id' => array('type' => 'auto', 'nullable' => false),
				'owner' => array('type' => 'int', 'precision' => 8),
				'playlist_title' => array('type' => 'varchar', 'precision' => 255),
				'private' => array('type' => 'int', 'precision' => 2, 'default' => 0)
			),
			'pk' => array('id'),
			'fk' => array(),
			'ix' => array(),
			'uc' => array()
		),
		'phpgw_musiclib_playlist_contents' => array(
			'fd' => array(
				'id' => array('type' => 'auto', 'nullable' => false),
				'playlist_id' => array('type' => 'int', 'precision' => 8),
				'play_order'  => array('type' => 'int', 'precision' => 8),
				
				# this duplication exists so that an attempt can be made to self-repair a playlist
				# in the case where songs are removed and reinserted into the database
				'artist_name' => array('type' => 'varchar', 'precision' => 255),
				'album_title' => array('type' => 'varchar', 'precision' => 255),
				'track' => array('type' => 'varchar', 'precision' => 2),
				
				'song_table' => array('type' => 'int', 'precision' => 2),
				'song_id' => array('type' => 'int', 'precision' => 8)
			),
			'pk' => array('id'),
			'fk' => array('playlist_id,song_id'),
			'ix' => array(),
			'uc' => array()
		),
		'phpgw_musiclib_misc' => array(
			'fd' => array(
				'id' => array('type' => 'auto', 'nullable' => false),
				'path' => array('type' => 'varchar', 'precision' => 255),
				'filename' => array('type' => 'varchar', 'precision' => 255),

				# these will be used to store id3 tag values
				'artist_name' => array('type' => 'varchar', 'precision' => 255),
				'album_title' => array('type' => 'varchar', 'precision' => 255),
				'track' => array('type' => 'varchar', 'precision' => 2),
				'year' => array('type' => 'int', 'precision' => 4),
				'genre_id' => array('type' => 'int', 'precision' => 8),
				'comment' => array('type' => 'text'),

				'times_played' => array('type' => 'int', 'precision' => 8, 'default' => 0),
				'random_play' => array('type' => 'int', 'precision' => 2, 'default' => 1)
			),
			'pk' => array('id'),
			'fk' => array(),
			'ix' => array(),
			'uc' => array()
		),
		'phpgw_musiclib_genre' => array(
			'fd' => array(
				'id' => array('type' => 'auto', 'nullable' => false),
				'genre' => array('type' => 'varchar', 'precision' => 64)
			),
			'pk' => array('id'),
			'fk' => array(),
			'ix' => array(),
			'uc' => array()
		),
		'phpgw_musiclib_preferences' => array(
			'fd' => array(
				'id' => array('type' => 'auto', 'nullable' => false),
				'owner' => array('type' => 'int', 'precision' => 8),
				'preference_name' => array('type' => 'varchar', 'precision' => 32),
				'preference_value' => array('type' => 'varchar', 'precision' => 255)
			),
			'pk' => array('id'),
			'fk' => array(),
			'ix' => array(),
			'uc' => array()
		)
		
	);
?>
Return current item: Axis Groupware