Removed old metadata table - this information is now split between the
"files", "playlist", and "playlistcontents" tables.
This commit is contained in:
parent
017064310f
commit
19780fd997
|
@ -68,3 +68,4 @@ ALTER TABLE cc_schedule ADD CONSTRAINT unique_id UNIQUE (id);
|
|||
|
||||
CREATE SEQUENCE schedule_group_id_seq;
|
||||
|
||||
DROP TABLE cc_mdata CASCADE;
|
||||
|
|
|
@ -90,16 +90,8 @@ function camp_empty_db($db) {
|
|||
$sql = "DELETE FROM ".$CC_CONFIG['filesTable'];
|
||||
camp_install_query($sql, false);
|
||||
}
|
||||
else {
|
||||
echo " * Skipping: database table ".$CC_CONFIG['prefTable']."\n";
|
||||
}
|
||||
if (camp_db_table_exists($CC_CONFIG['mdataTable'])) {
|
||||
echo " * Deleting from database table ".$CC_CONFIG['mdataTable']."\n";
|
||||
$sql = "DELETE FROM ".$CC_CONFIG['mdataTable'];
|
||||
camp_install_query($sql, false);
|
||||
}
|
||||
else {
|
||||
echo " * Skipping: database table ".$CC_CONFIG['mdataTable']."\n";
|
||||
else {
|
||||
echo " * Skipping: database table ".$CC_CONFIG['filesTable']."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -117,7 +117,6 @@ $CC_CONFIG = array(
|
|||
$CC_CONFIG['playListTable'] = $CC_CONFIG['tblNamePrefix'].'playlist';
|
||||
$CC_CONFIG['playListContentsTable'] = $CC_CONFIG['tblNamePrefix'].'playlistcontents';
|
||||
$CC_CONFIG['filesTable'] = $CC_CONFIG['tblNamePrefix'].'files';
|
||||
$CC_CONFIG['mdataTable'] = $CC_CONFIG['tblNamePrefix'].'mdata';
|
||||
$CC_CONFIG['accessTable'] = $CC_CONFIG['tblNamePrefix'].'access';
|
||||
$CC_CONFIG['permTable'] = $CC_CONFIG['tblNamePrefix'].'perms';
|
||||
$CC_CONFIG['sessTable'] = $CC_CONFIG['tblNamePrefix'].'sess';
|
||||
|
@ -136,7 +135,6 @@ $CC_CONFIG['prefSequence'] = $CC_CONFIG['prefTable'].'_id';
|
|||
$CC_CONFIG['permSequence'] = $CC_CONFIG['permTable'].'_id';
|
||||
$CC_CONFIG['subjSequence'] = $CC_CONFIG['subjTable'].'_id';
|
||||
$CC_CONFIG['smembSequence'] = $CC_CONFIG['smembTable'].'_id';
|
||||
$CC_CONFIG['mdataSequence'] = $CC_CONFIG['mdataTable'].'_id';
|
||||
|
||||
$CC_CONFIG['sysSubjs'] = array(
|
||||
'root', /*$CC_CONFIG['AdminsGr'],*/ /*$CC_CONFIG['AllGr'],*/ $CC_CONFIG['StationPrefsGr']
|
||||
|
|
|
@ -256,8 +256,8 @@ if (!camp_db_table_exists($CC_CONFIG['playListContentsTable'])) {
|
|||
REFERENCES ".$CC_CONFIG['filesTable']." (id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE OR REPLACE FUNCTION calculate_position() RETURNS trigger AS
|
||||
|
||||
CREATE OR REPLACE FUNCTION calculate_position() RETURNS trigger AS
|
||||
\$calc_pos\$
|
||||
BEGIN
|
||||
IF(TG_OP='INSERT') THEN
|
||||
|
@ -272,8 +272,8 @@ if (!camp_db_table_exists($CC_CONFIG['playListContentsTable'])) {
|
|||
LANGUAGE 'plpgsql';
|
||||
|
||||
CREATE TRIGGER calculate_position AFTER INSERT OR DELETE ON ".$CC_CONFIG['playListContentsTable']."
|
||||
FOR EACH ROW EXECUTE PROCEDURE calculate_position();";
|
||||
|
||||
FOR EACH ROW EXECUTE PROCEDURE calculate_position();";
|
||||
|
||||
camp_install_query($sql);
|
||||
|
||||
} else {
|
||||
|
@ -294,54 +294,6 @@ if (!camp_db_table_exists($CC_CONFIG['playListContentsTable'])) {
|
|||
// echo " * Skipping: database sequence already exists: ".$CC_CONFIG['filesSequence']."\n";
|
||||
//}
|
||||
|
||||
/**
|
||||
* id subjns subject predns predicate objns object
|
||||
* y1 literal xmbf NULL namespace literal http://www.sotf.org/xbmf
|
||||
* x1 gunid <gunid> xbmf contributor NULL NULL
|
||||
* x2 mdid x1 xbmf role literal Editor
|
||||
*
|
||||
* predefined shortcuts:
|
||||
* _L = literal
|
||||
* _G = gunid (global id of media file)
|
||||
* _I = mdid (local id of metadata record)
|
||||
* _nssshortcut = namespace shortcut definition
|
||||
* _blank = blank node
|
||||
*/
|
||||
if (!camp_db_table_exists($CC_CONFIG['mdataTable'])) {
|
||||
echo " * Creating database table ".$CC_CONFIG['mdataTable']."...";
|
||||
//$CC_DBC->createSequence($CC_CONFIG['mdataSequence']);
|
||||
$sql = "CREATE TABLE ".$CC_CONFIG['mdataTable']." (
|
||||
id SERIAL PRIMARY KEY,
|
||||
gunid bigint,
|
||||
subjns varchar(255), -- subject namespace shortcut/uri
|
||||
subject varchar(255) not null default '',
|
||||
predns varchar(255), -- predicate namespace shortcut/uri
|
||||
predicate varchar(255) not null,
|
||||
predxml char(1) not null default 'T', -- Tag or Attribute
|
||||
objns varchar(255), -- object namespace shortcut/uri
|
||||
object text
|
||||
)";
|
||||
camp_install_query($sql, false);
|
||||
|
||||
// $sql = "CREATE UNIQUE INDEX ".$CC_CONFIG['mdataTable']."_id_idx
|
||||
// ON ".$CC_CONFIG['mdataTable']." (id)";
|
||||
// camp_install_query($sql, false);
|
||||
|
||||
$sql = "CREATE INDEX ".$CC_CONFIG['mdataTable']."_gunid_idx
|
||||
ON ".$CC_CONFIG['mdataTable']." (gunid)";
|
||||
camp_install_query($sql, false);
|
||||
|
||||
$sql = "CREATE INDEX ".$CC_CONFIG['mdataTable']."_subj_idx
|
||||
ON ".$CC_CONFIG['mdataTable']." (subjns, subject)";
|
||||
camp_install_query($sql, false);
|
||||
|
||||
$sql = "CREATE INDEX ".$CC_CONFIG['mdataTable']."_pred_idx
|
||||
ON ".$CC_CONFIG['mdataTable']." (predns, predicate)";
|
||||
camp_install_query($sql);
|
||||
} else {
|
||||
echo " * Skipping: database table already exists: ".$CC_CONFIG['mdataTable']."\n";
|
||||
}
|
||||
|
||||
if (!camp_db_table_exists($CC_CONFIG['accessTable'])) {
|
||||
echo " * Creating database table ".$CC_CONFIG['accessTable']."...";
|
||||
$sql = "CREATE TABLE ".$CC_CONFIG['accessTable']." (
|
||||
|
|
|
@ -94,17 +94,6 @@ if (camp_db_table_exists($CC_CONFIG['transTable'])) {
|
|||
echo " * Skipping: database table ".$CC_CONFIG['transTable']."\n";
|
||||
}
|
||||
|
||||
if (camp_db_table_exists($CC_CONFIG['mdataTable'])) {
|
||||
echo " * Removing database table ".$CC_CONFIG['mdataTable']."...";
|
||||
$sql = "DROP TABLE ".$CC_CONFIG['mdataTable'];
|
||||
camp_install_query($sql, false);
|
||||
|
||||
$CC_DBC->dropSequence($CC_CONFIG['mdataTable']."_id");
|
||||
echo "done.\n";
|
||||
} else {
|
||||
echo " * Skipping: database table ".$CC_CONFIG['mdataTable']."\n";
|
||||
}
|
||||
|
||||
if (camp_db_table_exists($CC_CONFIG['filesTable'])) {
|
||||
echo " * Removing database table ".$CC_CONFIG['filesTable']."...";
|
||||
$sql = "DROP TABLE ".$CC_CONFIG['filesTable']." CASCADE";
|
||||
|
|
Loading…
Reference in New Issue