[英]TYPO3 Extension: create database view during installation
In my TYPO3 extension I use a foreign table. 在我的TYPO3扩展名中,我使用了一个外部表。 I've created 2 views providing data of this table in the manner my extension needs.
我已经创建了2个视图,以我的扩展程序需要的方式提供此表的数据。
The question is - how can these views be created at installation time? 问题是-在安装时如何创建这些视图?
Views defined in " ext_tables.sql " are ingored by installation routine. 安装例程会迷惑“ ext_tables.sql ”中定义的视图。
I've tried to use file " ext_tables_static+adt.sql ". 我尝试使用文件“ ext_tables_static + adt.sql ”。 This variant works only for
INSERT
statements. 此变体仅适用于
INSERT
语句。
The only thing I've got to work is variant described here using signal slot dispatcher (sounds complicated but it is really not! Provided documentation is very good). 我唯一需要做的就是在这里使用信号槽分配器描述变体(听起来很复杂,但实际上并非如此!提供的文档非常好)。
But I can't believe it that there is no native way (like ext_tables.sql
) to solve such problems. 但是我不敢相信没有本地方法(例如
ext_tables.sql
)可以解决这些问题。
I did some research on this issue some time ago. 我前一段时间对此问题做了一些研究。 There was no other way to achive what you want at that time and I doubt there's evolved a new one in the meantime.
当时没有其他方法可以满足您的需求,我怀疑与此同时已经开发了一种新方法。
Configuration/SQL/*.sql
from my extension. Configuration/SQL/*.sql
。 CREATE TABLE
(pseudo) statements. CREATE TABLE
(伪)语句。 Use signal TYPO3\\CMS\\Install\\Service\\SqlExpectedSchemaService
- tablesDefinitionIsBeingBuilt
for this. tablesDefinitionIsBeingBuilt
,请使用信号TYPO3\\CMS\\Install\\Service\\SqlExpectedSchemaService
- tablesDefinitionIsBeingBuilt
。 It is used in TYPO3 core in TYPO3\\CMS\\Core\\Category\\CategoryRegistry::addCategoryDatabaseSchemaToTablesDefinition
TYPO3\\CMS\\Core\\Category\\CategoryRegistry::addCategoryDatabaseSchemaToTablesDefinition
中的TYPO3核心中使用它 Be aware that there's no way to teach install tool's database analyzer your views so it will keep nagging you about removing them. 请注意,无法教您安装工具的数据库分析器您的视图,因此它将一直困扰您删除视图。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.