Book Image

TYPO3 Extension Development

Book Image

TYPO3 Extension Development

Overview of this book

Table of Contents (13 chapters)

Adjusting the Database


Let's review the generated code and decide if we need to change anything.

The table information is spread among three files. We start from the SQL definitions and continue to the TYPO3 definitions.

ext_tables.sql

The first file is ext_tables.sql. It contains SQL definitions for our new tables. Kickstarter generated SQL statements that are generally suitable for most cases. However, generated statements are not optimal. Kickstarter used text and tinytext fields where we could use the int fields. This will minimize the database size and let us receive the database query results faster. So, we change field definitions according to the following:

Table name

Field name

Old type

New type

tx_feuserstat_sessions

fe_user

text

int(11) DEFAULT '0' NOT NULL

 

first_page

text

int(11) DEFAULT '0' NOT NULL

 

last_page

text

int(11) DEFAULT '0' NOT NULL

tx_feuserstat_pagestats

fe_user

text

int(11) DEFAULT '0' NOT NULL

 

sesstat_uid

text

int(11) DEFAULT '0' NOT NULL

 ...