Skip to content

Install Database

Squash TM is delivered with an H2 database by default. This database can be used for evaluation purposes. However, its use in a production context is highly discouraged.

Squash TM is compatible with two Open Source DBMS: PostgreSQL and MariaDB. Here are the versions we recommend:

  • PostgreSQL 11. The minimum version compatible with Squash TM is version 9.6.
  • MariaDB 10.5. The minimum version compatible with Squash TM is version 10.2.

PostgreSQL

To create a new UTF8 database for Squash TM, enter the following queries using a user with full rights:

CREATE DATABASE squashtm WITH ENCODING='UTF8';
CREATE USER "squash-tm" WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE squashtm TO "squash-tm";
GRANT CONNECT ON DATABASE squashtm TO postgres;

Change the role of the "squash-tm" user because you need to install the extension "uuid-ossp" to the Squash TM database, and that is only possible for a superuser:

Alter ROLE "squash-tm" with SUPERUSER;

Then, run the database population script with the "squash-tm" user. This script is located in the Squash TM archive in the repository database-scripts:

  • postgresql-full-install-version-2.X.X.RELEASE.sql

Once you have run the script, you must take away the superuser role from the "squash-tm" user:

Alter ROLE "squash-tm" with NOSUPERUSER;

Focus

For PostgreSQL databases, actions on the database such as saving, recovering data, and running scripts must be done using the "squash-tm user", not the "postgres" user.
Make sure that the "squash-tm" user has superuser permissions when you run scripts and save the database.

Info

Deleting large objects (such as attachments) in PostgreSQL does not remove the data (only the link to the data).
To delete data, you must use the vaccumlo feature (see PostgreSQL documentation) to clean the database.

MariaDB

Create a new UTF8 database for Squash TM, using a user with full privileges:

CREATE DATABASE IF NOT EXISTS squashtm CHARACTER SET utf8 COLLATE utf8_bin;
CREATE USER 'squash-tm'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON squashtm.* TO 'squash-tm'@'localhost';
FLUSH PRIVILEGES;

Then, run the databse population script with the user squash-tm'@'localhost'. This script is located in the Squash TM archive, in the repository database-scripts:

  • mysql-full-install-version-2.X.X.RELEASE.sql

Warning

You must absolutely use InnoDB. The database engine must absolutely be a transactional database engine.
For example, the engine MyISAM is not transactional and can corrupt your data. Henix does not recommend you to use it and if you do, Henix is not responsible for the issues created by this use.

Info

Configure MariaDB

The @@sql_mode variable must contain the following tags:

NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

It must not contains the following elements:

ONLY_FULL_GROUP_BY
EMPTY_STRING_IS_NULL
NO_BACKSLASH_ESCAPES

You must define the variables in the configuration file my.ini, in the part [mysqld].

Back to top