I use postgresql and spent some time manually creating the tables for this module tonight. Here are the tables I came up with. They'll need to be drupalized.

CREATE TABLE audio (
    vid integer NOT NULL default '0'
        CHECK (vid >= 0),
    nid integer NOT NULL default '0'
        CHECK (nid >= 0),
    title_format varchar(128) default '',
    play_count integer NOT NULL default '0'
        CHECK (play_count >= 0),
    download_count integer NOT NULL default '0'
        CHECK (download_count >= 0),
    downloadable smallint NOT NULL default '1',
    fileformat varchar(10) NOT NULL default '',
    sample_rate integer NOT NULL default '0'
        CHECK (sample_rate >= 0),
    channel_mode varchar(10) NOT NULL default '',
    bitrate float NOT NULL default '0'
        CHECK (bitrate >= 0),
    bitrate_mode varchar(4) NOT NULL default '',
    playtime varchar(10) NOT NULL default '',
    PRIMARY KEY  (vid)
);

CREATE TABLE  audio_file (
    vid integer NOT NULL default '0'
        CHECK (vid >= 0),
    origname varchar(255) NOT NULL default '',
    filename varchar(255) NOT NULL default '',
    filepath varchar(255) NOT NULL default '',
    filemime varchar(255) NOT NULL default '',
    filesize integer NOT NULL default '0'
        CHECK (filesize >= 0),
    PRIMARY KEY  (vid)
);

CREATE TABLE  audio_metadata (
    vid integer NOT NULL default '0'
        CHECK (vid >= 0),
    tag varchar(45) NOT NULL default '',
    value varchar(255) NOT NULL default '',
    clean varchar(255) NOT NULL default '',
    PRIMARY KEY  (vid, tag, value),
    CONSTRAINT audio_metadata_tags UNIQUE (clean)
);
CommentFileSizeAuthor
#4 audio.install_0.patch2.41 KBdrewish
#1 audio.install.patch2.47 KBdrewish

Comments

drewish’s picture

Status: Active » Needs review
StatusFileSize
new2.47 KB

could you try applying this patch and re-installing the module?

Anonymous’s picture

Worked! Thanks.

Curtis.

Anonymous’s picture

oh, but you know what -- I made a mistake. YOu'll want to remove the bit that says "CONSTRAINT audio_metadata_tags UNIQUE (clean)"

drewish’s picture

StatusFileSize
new2.41 KB

could you double check this patch and make sure it works? and do you mind if i pester you to look at other postgresql code?

drewish’s picture

Status: Needs review » Fixed

Well, I'm gonna assume that all is right and go ahead and commit this. Thanks a ton!

Anonymous’s picture

Status: Fixed » Closed (fixed)