|
From: | Henri-Damien LAURENT |
Subject: | Re: [Koha-devel] Structure of action_logs table |
Date: | Wed Aug 3 03:33:27 2005 |
User-agent: | Mozilla Thunderbird 1.0.2 (X11/20050322) |
Tarallo, Andres a écrit :
I'm doing some work with C4::Logs.I've ported to this module a function for doing logs to a file that we've developed locally. I've noticed that if your koha system doesn't have an action_logs table logactions complains about it and does nothing. So I've added some code to create the table automagically and record to it.I need the "Official" structure of this table, since I created it with my best guess.I plan to contribute this back to the project.
Champ Type Interclassement Attributs Null Défaut Extra Action_timestamp_ timestamp Oui CURRENT_TIMESTAMP Modifier <http://work.henridamienlaurent.dyndns.org/phpmyadmin/tbl_alter.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&field=timestamp> Supprimer <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+DROP+%60timestamp%60&cpurge=1&purgekey=timestamp&zero_rows=Le+champ+timestamp+a+%C3%A9t%C3%A9+effac%C3%A9> Primaire <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+DROP+PRIMARY+KEY%2C+ADD+PRIMARY+KEY%28%60timestamp%60%29&zero_rows=Une+cl%C3%A9+primaire+a+%C3%A9t%C3%A9+ajout%C3%A9e+sur+timestamp> Index <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+ADD+INDEX%28%60timestamp%60%29&zero_rows=Un+index+a+%C3%A9t%C3%A9+ajout%C3%A9+sur+timestamp> Unique <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+ADD+UNIQUE%28%60timestamp%60%29&zero_rows=Un+index+a+%C3%A9t%C3%A9+ajout%C3%A9+sur+timestamp> Texte entier _user_ int(11) Non 0 Modifier <http://work.henridamienlaurent.dyndns.org/phpmyadmin/tbl_alter.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&field=user> Supprimer <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+DROP+%60user%60&cpurge=1&purgekey=user&zero_rows=Le+champ+user+a+%C3%A9t%C3%A9+effac%C3%A9> Primaire <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+DROP+PRIMARY+KEY%2C+ADD+PRIMARY+KEY%28%60user%60%29&zero_rows=Une+cl%C3%A9+primaire+a+%C3%A9t%C3%A9+ajout%C3%A9e+sur+user> Index <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+ADD+INDEX%28%60user%60%29&zero_rows=Un+index+a+%C3%A9t%C3%A9+ajout%C3%A9+sur+user> Unique <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+ADD+UNIQUE%28%60user%60%29&zero_rows=Un+index+a+%C3%A9t%C3%A9+ajout%C3%A9+sur+user> Texte entier module text latin1_swedish_ci Non Modifier <http://work.henridamienlaurent.dyndns.org/phpmyadmin/tbl_alter.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&field=module> Supprimer <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+DROP+%60module%60&cpurge=1&purgekey=module&zero_rows=Le+champ+module+a+%C3%A9t%C3%A9+effac%C3%A9> Primaire Index Unique Texte entier <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+ADD+FULLTEXT%28%60module%60%29&zero_rows=Un+index+a+%C3%A9t%C3%A9+ajout%C3%A9+sur+module> action text latin1_swedish_ci Non Modifier <http://work.henridamienlaurent.dyndns.org/phpmyadmin/tbl_alter.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&field=action> Supprimer <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+DROP+%60action%60&cpurge=1&purgekey=action&zero_rows=Le+champ+action+a+%C3%A9t%C3%A9+effac%C3%A9> Primaire Index Unique Texte entier <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+ADD+FULLTEXT%28%60action%60%29&zero_rows=Un+index+a+%C3%A9t%C3%A9+ajout%C3%A9+sur+action> object int(11) Oui /NULL/ Modifier <http://work.henridamienlaurent.dyndns.org/phpmyadmin/tbl_alter.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&field=object> Supprimer <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+DROP+%60object%60&cpurge=1&purgekey=object&zero_rows=Le+champ+object+a+%C3%A9t%C3%A9+effac%C3%A9> Primaire <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+DROP+PRIMARY+KEY%2C+ADD+PRIMARY+KEY%28%60object%60%29&zero_rows=Une+cl%C3%A9+primaire+a+%C3%A9t%C3%A9+ajout%C3%A9e+sur+object> Index <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+ADD+INDEX%28%60object%60%29&zero_rows=Un+index+a+%C3%A9t%C3%A9+ajout%C3%A9+sur+object> Unique <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+ADD+UNIQUE%28%60object%60%29&zero_rows=Un+index+a+%C3%A9t%C3%A9+ajout%C3%A9+sur+object> Texte entier info text latin1_swedish_ci Non Modifier <http://work.henridamienlaurent.dyndns.org/phpmyadmin/tbl_alter.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&field=info> Supprimer <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+DROP+%60info%60&cpurge=1&purgekey=info&zero_rows=Le+champ+info+a+%C3%A9t%C3%A9+effac%C3%A9> Primaire Index Unique Texte entier <http://work.henridamienlaurent.dyndns.org/phpmyadmin/sql.php?lang=fr-utf-8&server=1&collation_connection=utf8_general_ci&db=kohatest&table=action_logs&goto=tbl_properties_structure.php&back=tbl_properties_structure.php&sql_query=ALTER+TABLE+%60action_logs%60+ADD+FULLTEXT%28%60info%60%29&zero_rows=Un+index+a+%C3%A9t%C3%A9+ajout%C3%A9+sur+info>
Here you are. Anyway, It is in updatedatabase. User is borrowernumber Module and action are developper texte updated when inserting a log entry.Object is the primary key of modified object, shouldn't be null (discovered a design problem). Info contains information which was set, if needed should be able to get NULL Values (discovered a design problem).
Many Thanks for contributions. -- Henri-Damien LAURENT
[Prev in Thread] | Current Thread | [Next in Thread] |