[TYPO3-core] RFC #16177: Add DB structure update pre-processing hook in EM
Xavier Perseguers
typo3 at perseguers.ch
Tue Nov 2 14:55:37 CET 2010
Hi,
Franz Holzinger wrote:
> Le 02/11/2010 13:30, Xavier Perseguers a écrit :
>>> Could this patch be modified that the hook can be reached even without a
>>> file ext_tables.sql?
>>> AFAIK only the file ext_tables_static+adt.sql is allowed to contain
>>> INSERT commands.
>>
>> But if you provide a ext_tables_static+adt.sql, you should still have a
>> corresponding ext_tables.sql file.
>>
>
> No, I do not have any ext_tables.sql file, because this is in the
> extension statictemplates. And the extension mastertemplates only wants
> to insert records there.
Quoting the Core documentation:
http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.2.0/view/2/1/
ext_tables_static+adt.sql
Static SQL tables and their data.
If the extension requires static data you can dump it into a sql-file by
this name.Example for dumping mysql data from bash (being in the
extension directory):mysqldump --password=[password] [database name]
[tablename] --add-drop-table > ./ext_tables_static.sql--add-drop-table
will make sure to include a DROP TABLE statement so any data is inserted
in a fresh table.
You can also drop the table content using the EM in the backend.
vvvvvvv
Notice: The table structure of static tables needs to be in the
ext_tables.sql file as well - otherwise an installed static table will
be reported as being in excess in the EM!
^^^^^^
Thus you need a file ext_tables.sql even if it comes from "another
extension". I did that in some of my extensions where I have a "master"
extension that provides the database structure and others that have
country-wide static data. Each and every of these children extensions
have a copy of the database definition.
Xavier
More information about the TYPO3-team-core
mailing list