Zum Inhalt springen

DAM Tabelle tx_dam läßt sich nicht installieren

Erstellt am 12. Dezember 2008 · 14 Antworten · letzte Antwort am 18. Februar 2009

Tags: Dateien & FAL, Datenbank, TYPO3 4, Frage

ernstle ·

Hallo,
ich arbeite mit Typo 4.2.3 und DAM 1.0.14
Trotz mehrfacher Versuche kan ich die Tabelle tx_dam im Install-Tool/DB-Analyser/Compare nicht installieren.
Dort wird angezeigt:

Add fields
ALTER TABLE sys_refindex ADD KEY lookup_string (ref_table,ref_string(400));

Add tables CREATE TABLE tx_dam (
uid int(11) NOT NULL auto_increment,
pid int(11) NOT NULL default '0',
tstamp int(11) unsigned NOT NULL default '0',
usw...

Was mir weiter auffällt ist, das bei der ext "DAM"
in phpmyadmin latin1_swedish_c1 als Sprachversion angezeigt wird

Danke im Voraus für Euere Unterstützung
Ernst

ernstle ·

Nun habe ich versucht, die Tabelle tx_dam manuell über phpmyadmin zu installieren.
Den SQL-Code für tx_dam habe ich aus der Datei ext_tables.sql entnommen.

Bei der Installation in phpmyadmin bringt er mir jetzt folgenden Fehler:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 134

Der SQL-Code :

CREATE TABLE tx_dam (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,

# defines the file as a child of a group
parent_id int(11) DEFAULT '0' NOT NULL,

# might be handy to reconnect a record to a reuploaded file
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,

# like hidden but not active means: don`t use in element browser (insert content in page)
#TODO remove?!
active tinyint(4) unsigned DEFAULT '0' NOT NULL,

#TODO remove?!
sorting int(10) unsigned DEFAULT '0' NOT NULL,

# could be usefull for frontend applications which use the dam data
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
starttime int(11) unsigned DEFAULT '0' NOT NULL,
endtime int(11) unsigned DEFAULT '0' NOT NULL,
fe_group int(11) DEFAULT '0' NOT NULL,

# languages
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l18n_parent int(11) DEFAULT '0' NOT NULL,
l18n_diffsource mediumblob,

# versioning
t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3ver_id int(11) DEFAULT '0' NOT NULL,
t3ver_label varchar(30) DEFAULT '' NOT NULL,

# Inspired by dublin core
#
# Image, Text, Sound, Dataset (cvs, xml),
# Interactive (flash), Software (exe, zip),
# Collection (div data in zip),
# Service (uri,...), Anything/Sonstiges
media_type tinyint(4) unsigned DEFAULT '0' NOT NULL,

title tinytext,
category int(11) DEFAULT '0' NOT NULL,

# man(ual), auto, cron
index_type varchar(4) DEFAULT '' NOT NULL,

# unix 'file' command gives mime type
# needed because of the lack of file extensions on mac
file_mime_type varchar(45) DEFAULT '' NOT NULL,
file_mime_subtype varchar(45) DEFAULT '' NOT NULL,

# psd,doc,tif
file_type varchar(4) DEFAULT '' NOT NULL,

# pdf: 1.3
file_type_version varchar(9) DEFAULT '' NOT NULL,

file_name varchar(255) DEFAULT '' NOT NULL,
file_path text,
file_size int(11) unsigned DEFAULT '0' NOT NULL,
file_mtime int(11) unsigned DEFAULT '0' NOT NULL,
file_inode int(11) DEFAULT '0' NOT NULL,

# date of file creation
file_ctime int(11) unsigned DEFAULT '0' NOT NULL,

# hex md5 of file content using file_md5()
# to be able to identify the file exactly
file_hash varchar(32) DEFAULT '' NOT NULL,

# 0=ok, 1=needs refresh etc.
file_status tinyint(4) unsigned DEFAULT '0' NOT NULL,

# index a cd:
# create usable images in size 600x600 and copy to folder
# or copy the files from a location (network) to folder
# the location is then: "photo stock picture cd 8"
file_orig_location varchar(255) DEFAULT '' NOT NULL,
file_orig_loc_desc varchar(45) DEFAULT '' NOT NULL,

# pdf: Acrobat Distiller
file_creator varchar(45) DEFAULT '' NOT NULL,

# name that should be used for download
file_dl_name varchar(255) DEFAULT '' NOT NULL,

# dummy field for relation to content elements
file_usage int(11) unsigned DEFAULT '0' NOT NULL,

# xml / array
meta text,

# sku / bestell nr
# for custom use. DAM don`t use this
ident varchar(45) DEFAULT '' NOT NULL,

# photographer
creator varchar(45) DEFAULT '' NOT NULL,

keywords tinytext,
description text,

# for web or FE applications
alt_text varchar(255) DEFAULT '' NOT NULL,
caption text,

# if not set by hand, the first kb of a pdf, doc file for example
abstract text,

# for searching and non editable: the first 60 kb of a pdf, doc file for example
search_content text,

# document language
language char(3) DEFAULT '' NOT NULL,

# text document include x pages
pages int(4) unsigned DEFAULT '0' NOT NULL,

# vendor?
publisher varchar(45) DEFAULT '' NOT NULL,
copyright varchar(128-) DEFAULT '' NOT NULL,

# instructions and notes
instructions tinytext,

# created, modified
# date_cr don`t have to be the file creation time. It is the time a photo is shooten not the time the slide is scanned and saved
date_cr int(11) unsigned DEFAULT '0' NOT NULL,
# last modification. Not neccessarily the file modification time
date_mod int(11) unsigned DEFAULT '0' NOT NULL,

# location: what do you see on the picture?
loc_desc varchar(45) DEFAULT '' NOT NULL,
loc_country char(3) DEFAULT '' NOT NULL,
loc_city varchar(45) DEFAULT '' NOT NULL,

# dpi
hres int(11) unsigned DEFAULT '0' NOT NULL,
vres int(11) unsigned DEFAULT '0' NOT NULL,

# size in pixel
hpixels int(11) unsigned DEFAULT '0' NOT NULL,
vpixels int(11) unsigned DEFAULT '0' NOT NULL,

# RGB,sRGB,YUV, ...
color_space varchar(4) DEFAULT '' NOT NULL,

# 21 cm, 29.7 cm: A4
width float unsigned DEFAULT '0' NOT NULL,
height float unsigned DEFAULT '0' NOT NULL,
# px,mm,cm,m,p, ...
height_unit char(3) DEFAULT '' NOT NULL,

# FULLTEXT (title),
# FULLTEXT (keywords),
# FULLTEXT (description),
# FULLTEXT (abstract),
# FULLTEXT (creator),
# FULLTEXT (search_content),
# FULLTEXT (instructions),
# FULLTEXT (file_orig_loc_desc),

PRIMARY KEY (uid),
KEY parent (pid),
KEY media_type (media_type),
KEY t3ver_oid (t3ver_oid),
KEY file_type (file_type),
KEY file_hash (file_hash),
KEY file_name (file_name),
);

digedag ·
KEY file_hash (file_hash),
KEY file_name (file_name),  <- falsch
);

Nimm mal das letzte Komma raus. Das mag SQL nicht. 🙂

ernstle ·

@digedag Danke für Deine Antwort.
Ich habe jetzt die allerneuster Version der DAM Ext von lists.netfielders.de heruntergeladen und eine Installation probiert. Das Komma am Ende des SQL-Scrupt nicht mehr vorhanden.

Ich habe in dem Typo3-Install-Tool den Wert SQLDEBUG angesetzt:
Darauf bringt er beim Installierten folgende Fehlermeldung:

BLOB/TEXT column 'file_name' used in key specification without a key length

Die Tabelle tx_dam wird nach wie vor nicht installiert.
Ernst

digedag ·

Dann laß doch den Key erstmal weg und leg ihn hinterher manuell an. Das geht z.B. im phpMyAdmin in der Strukturansicht der Tabelle. Unter der Liste der Indizes kannst du einen neuen Index anlegen.

Ist aber schon recht seltsam, daß sich MySQL so gegen die Tabelle sträubt...

ernstle ·

Habe jetzt die neueste Dam-Version 1.1.0 vom TER installiert. Fehler trat wieder auf.

Dann habe ich das Anlegen der Tabelle nicht über die Ext phpmyadmin, sondern die phpmyadmin-Version von meinem Hoster installiert. Dann ging es. Allerdings habe ich vorher das Komma, wie oben erwähnt, entfernt.

Danke für die Unterstützung

fearistic ·

Ich habe da gleiche Problem.

In phpmyadmin habe ich nun den Key nicht erstellt. Wenn ich in der Strukturansicht dann nach Erstellen der Tabelle bin, kann ich nicht auf das Icon Index bei "file_name" klicken, das Icon ist ausgegraut. Wenn ich dennoch versuche ein Index zu erstellen, erhalte ich die hier bereits genannte Fehlermeldung: "#1170 - BLOB/TEXT column 'file_name' used in key specification without a key length"

Meine Daten: PHP Version 5.2.0
mysql Client API version 5.0.32
TYPO3: 4.2.3
dam: 1.1.1 - heute heruntergeladen (laut http://typo3.org/extensions/repository/ gab es heute auch ein Update)

Edit: Problemumgehung:
Ersetzte:

file_name text NOT NULL,
file_path text,

MIT:

file_name varchar( 200 ) NOT NULL default '',
file_path varchar( 255 ) NOT NULL default '',

Eine ganz hässliche Lösung.
Danach kann man wenn man über Loaded Extensions dam aufruft nochmal die Tabellen aktualisieren (file_name wird wieder angepasst).
"ALTER TABLE tx_dam CHANGE file_name file_name text;" kann hingegen nicht ausgeführt werden. 🙂

Kennt jemand einen besseren Weg?

digedag ·

Schon erstaunlich. Die Spalten sind als TEXT definiert und dann wird ein Index drüber gelegt? Soweit ich weiß, können in MySQL keine Indizes auf Blob-Felder erzeugt werden. Daher ist der Fehler beim Anlegen der Tabelle erklärbar. Es scheint sich also um einen Bug in DAM zu handeln.

In der aktuellen Version 1.0.15 im TER sind die Felder übrigens so definiert:

file_name varchar(255) DEFAULT '' NOT NULL,
file_path text,

Einen Index gibt es dann nur noch für das Feld file_name. Das sollte dann auch klappen!

fearistic ·

froemken, das ist mal klasse! Die Anleitung konnte ich gut gebrauchen, bzw. eigentlich vielmehr die Extension.

Ich weiß nur nicht was für einen sys_refindex-Fehler du meinst. Bei mir konnte die Extension 2 COLLATIONs nicht ändern:
sys_refindex: ref_string text latin1_swedish_ci (Direkt vor Nr. 49)
tx_realurl_uniqalias: value_alias text latin1_swedish_ci (Direkt vor Nr. 97)

Ersteres ist ja eine Spalte der Tabelle sys_refindex. Hat das was mit dem von dir erwähnten Problem zu tun?

froemken ·

Hier hast du unbewusst deinen Fehler geschildert:

ernstle schrieb

Trotz mehrfacher Versuche kan ich die Tabelle tx_dam im Install-Tool/DB-Analyser/Compare nicht installieren.
Dort wird angezeigt:

Add fields
ALTER TABLE sys_refindex ADD KEY lookup_string (ref_table,ref_string(400));
...

Ich bin kein Spezialist in Sachen DB. Hab mich mit diesem UTF-8-Kram mal ein bisschen beschäftigt, habe den SQL-String, den ich verwende auf mysql.org gefunden und dann daraus eine Extension programmiert.
In deinem Fall würde ich jetzt nicht zwanghaft versuchen diese beiden Tabellen auf UTF-8 umzuwandeln. Der ganze Page-Content steht ja eh in anderen Tabellen drin.

froemken

fearistic ·

Ich roll das Thema nochmal auf in Sachen COLLATIONs auf UTF-8 umzustellen.

Ich habe alles nach Anleitung gemacht (Internetseite), doch wenn ich neue Extensions installiere, ist die COLLATION bei denen immer auf Latin.

Hat jemand eine Idee, woran das liegen könnte?

froemken ·

Nagel mich jetzt bitte nicht fest, aber ich glaube das mit den Collations liegt an der Servereinstellung, wie der MySQL-Server gestartet wird...evtl. sind diese Einstellungen auch in der my.cf-Datei zu finden.
Wenn der Server also mit Latin gestartet wird, dann wird halt jede neu erstellt Tabelle in dem konfigurierten Zeichensatz (Latin) angelegt. Mein Script hat nicht die Möglichkeit den Server mit einem anderen Zeichensatz zu laden, deshalb entsteht dein Problem. Du müsstest dich also an deinen Provider wenden, oder die my.cf-Datei selber ändern.

Wenn hier jemand mehr Erfahrung hat als ich, dann bitte nicht zögern die "Antworten"-Taste zu drücken :-)

froemken