On Thu, 29 Mar 2007, Jonas Sandman wrote:

I am quite new at database and how to set them up properly so keep in mind
that the obvious might stare into your face but just point it out to me

Jonas,

  I strongly recommend that you read a book on database design. You have a
single, flat-file database that should be a multiple table, relational
database (e.g., multiple titles for the same artist: what if you mis-spell
an artist's name? Or that name changes?)

  Having the path as the primary key means that each database record is in a
different subdirectory, and that they're all unique. What value does the
path provide?

  How do you handle having a title (or artist) classified in more than a
single genre? What if one of those changes, can you be sure you've made all
the changes scattered throughout the database?

CREATE TABLE Files (path VARCHAR(255) PRIMARY KEY, title VARCHAR(255),
artist VARCHAR(255), album VARCHAR(255), genre VARCHAR(255), comment
VARCHAR(255), track INTEGER, year INTEGER, length INTEGER, bitrate INTEGER,
playcount INTEGER, changed INTEGER, size INTEGER, tagged INTEGER, extension
VARCHAR(5), file_exists INTEGER)";

  Stop what you're doing and learn how to do it properly and more
efficiently.

Rich

--
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.        |          Accelerator(TM)
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to