Answer the question
In order to leave comments, you need to log in
How to create tables in the database for your module?
Tell me how to create the necessary tables for it when installing your module. As I understand it, this should be done in the install/index.php file in the InstallDB method, but the syntax of the creation process is not very clear, which Bitrix classes should be accessed.
How to create a description for the fields of a table with all the parameters and is it possible to create a table using only the D7 syntax (since most of the module I have written in it)?
In the table, you need to create the following list of fields:
ID // stores the primary key with autoincrement
ELEMENT_ID
UF_XML_ID
ELEMENT_FIELDS // stores the serialized array of highload block element fields
HL_FIELDS
HLID
HLNAME
Answer the question
In order to leave comments, you need to log in
Tables in the database are created the old fashioned way through a SQL query create table
. Actually, you can take out the creation of tables from a separate file, for example, install.sql , and call in the installation method:
$sql = file_get_contents(__DIR__ .'/install.sql');
if ($sql) {
Bitrix\Main\Application::getConnection()->query($sql);
}
How to create a description for the fields of a table with all the parameters and is it possible to create a table using only the D7 syntax (since most of the module I have written in it)?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question