text: CREATE TABLE filters_flat_filter (idFlatFilter INT UNSIGNED AUTO_INCREMENT NOT NULL, title VARCHAR(150) NOT NULL, description VARCHAR(350) DEFAULT NULL, areaFrom NUMERIC(10, 2) DEFAULT NULL, areaTo NUMERIC(10, 2) DEFAULT NULL, priceFrom NUMERIC(10, 2) DEFAULT NULL, priceTo NUMERIC(10, 2) DEFAULT NULL, priceAreaFrom NUMERIC(10, 2) DEFAULT NULL, priceAreaTo NUMERIC(10, 2) DEFAULT NULL, constructionYearFrom SMALLINT UNSIGNED DEFAULT NULL, constructionYearTo SMALLINT UNSIGNED DEFAULT NULL, floorsCountFrom SMALLINT UNSIGNED DEFAULT NULL, floorsCountTo SMALLINT UNSIGNED DEFAULT NULL, roomsCount SMALLINT UNSIGNED DEFAULT NULL, buildingType SMALLINT UNSIGNED DEFAULT NULL, addedBy SMALLINT UNSIGNED DEFAULT NULL, marketType SMALLINT UNSIGNED DEFAULT NULL, dateCreated DATETIME NOT NULL, dateUpdated DATETIME DEFAULT NULL, dateLastSearch DATETIME DEFAULT NULL, city VARCHAR(100) DEFAULT NULL, region VARCHAR(100) DEFAULT NULL, subregion VARCHAR(100) DEFAULT NULL, district VARCHAR(100) DEFAULT NULL, searchFrequency NUMERIC(2, 2) NOT NULL, state SMALLINT UNSIGNED NOT NULL, idUser INT UNSIGNED NOT NULL, PRIMARY KEY(idFlatFilter)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
  CREATE TABLE filters_ground_filter (idGroundFilter INT UNSIGNED AUTO_INCREMENT NOT NULL, title VARCHAR(150) NOT NULL, description VARCHAR(350) DEFAULT NULL, groundAreaFrom DOUBLE PRECISION DEFAULT NULL, groundAreaTo DOUBLE PRECISION DEFAULT NULL, priceFrom NUMERIC(10, 2) DEFAULT NULL, priceTo NUMERIC(10, 2) DEFAULT NULL, priceAreaFrom NUMERIC(10, 2) DEFAULT NULL, priceAreaTo NUMERIC(10, 2) DEFAULT NULL, addedBy SMALLINT UNSIGNED DEFAULT NULL, dateCreated DATETIME NOT NULL, dateUpdated DATETIME DEFAULT NULL, dateLastSearch DATETIME DEFAULT NULL, city VARCHAR(100) DEFAULT NULL, region VARCHAR(100) DEFAULT NULL, subregion VARCHAR(100) DEFAULT NULL, district VARCHAR(100) DEFAULT NULL, searchFrequency NUMERIC(2, 2) NOT NULL, state SMALLINT UNSIGNED NOT NULL, idUser INT UNSIGNED NOT NULL, PRIMARY KEY(idGroundFilter)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
  CREATE TABLE filters_house_filter (idHouseFilter INT UNSIGNED AUTO_INCREMENT NOT NULL, title VARCHAR(150) NOT NULL, description VARCHAR(350) DEFAULT NULL, areaFrom NUMERIC(10, 2) DEFAULT NULL, areaTo NUMERIC(10, 2) DEFAULT NULL, priceFrom NUMERIC(10, 2) DEFAULT NULL, priceTo NUMERIC(10, 2) DEFAULT NULL, priceAreaFrom NUMERIC(10, 2) DEFAULT NULL, priceAreaTo NUMERIC(10, 2) DEFAULT NULL, groundAreaFrom DOUBLE PRECISION DEFAULT NULL, groundAreaTo DOUBLE PRECISION DEFAULT NULL, constructionYearFrom SMALLINT UNSIGNED DEFAULT NULL, constructionYearTo SMALLINT UNSIGNED DEFAULT NULL, roomsCountFrom SMALLINT UNSIGNED DEFAULT NULL, roomsCountTo SMALLINT UNSIGNED DEFAULT NULL, floorsCount SMALLINT UNSIGNED DEFAULT NULL, buildingType SMALLINT UNSIGNED DEFAULT NULL, addedBy SMALLINT UNSIGNED DEFAULT NULL, marketType SMALLINT UNSIGNED DEFAULT NULL, dateCreated DATETIME NOT NULL, dateUpdated DATETIME DEFAULT NULL, dateLastSearch DATETIME DEFAULT NULL, city VARCHAR(100) DEFAULT NULL, region VARCHAR(100) DEFAULT NULL, subregion VARCHAR(100) DEFAULT NULL, district VARCHAR(100) DEFAULT NULL, searchFrequency NUMERIC(2, 2) NOT NULL, state SMALLINT UNSIGNED NOT NULL, idUser INT UNSIGNED NOT NULL, PRIMARY KEY(idHouseFilter)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
  CREATE TABLE flat (id INT UNSIGNED AUTO_INCREMENT NOT NULL, title VARCHAR(150) NOT NULL, description VARCHAR(350) DEFAULT NULL, area NUMERIC(10, 2) DEFAULT NULL, price NUMERIC(10, 2) DEFAULT NULL, priceArea NUMERIC(10, 2) DEFAULT NULL, constructionYear SMALLINT UNSIGNED DEFAULT NULL, floorsCount SMALLINT UNSIGNED DEFAULT NULL, roomsCount SMALLINT UNSIGNED DEFAULT NULL, buildingType SMALLINT UNSIGNED DEFAULT NULL, addedBy SMALLINT UNSIGNED DEFAULT NULL, marketType SMALLINT UNSIGNED DEFAULT NULL, dateCreated DATETIME NOT NULL, dateUpdated DATETIME DEFAULT NULL, city VARCHAR(100) DEFAULT NULL, region VARCHAR(100) DEFAULT NULL, subregion VARCHAR(100) DEFAULT NULL, district VARCHAR(100) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
  CREATE TABLE ground (id INT UNSIGNED AUTO_INCREMENT NOT NULL, title VARCHAR(150) NOT NULL, description VARCHAR(350) DEFAULT NULL, groundArea DOUBLE PRECISION DEFAULT NULL, price NUMERIC(10, 2) DEFAULT NULL, priceArea NUMERIC(10, 2) DEFAULT NULL, addedBy SMALLINT UNSIGNED DEFAULT NULL, marketType SMALLINT UNSIGNED DEFAULT NULL, dateCreated DATETIME NOT NULL, dateUpdated DATETIME DEFAULT NULL, city VARCHAR(100) DEFAULT NULL, region VARCHAR(100) DEFAULT NULL, subregion VARCHAR(100) DEFAULT NULL, district VARCHAR(100) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
  CREATE TABLE house (id INT UNSIGNED AUTO_INCREMENT NOT NULL, title VARCHAR(150) NOT NULL, description VARCHAR(350) DEFAULT NULL, area NUMERIC(10, 2) DEFAULT NULL, price NUMERIC(10, 2) DEFAULT NULL, priceArea NUMERIC(10, 2) DEFAULT NULL, groundArea DOUBLE PRECISION DEFAULT NULL, constructionYear SMALLINT UNSIGNED DEFAULT NULL, floorsCount SMALLINT UNSIGNED DEFAULT NULL, roomsCount SMALLINT UNSIGNED DEFAULT NULL, buildingType SMALLINT UNSIGNED DEFAULT NULL, addedBy SMALLINT UNSIGNED DEFAULT NULL, marketType SMALLINT UNSIGNED DEFAULT NULL, dateCreated DATETIME NOT NULL, dateUpdated DATETIME DEFAULT NULL, city VARCHAR(100) DEFAULT NULL, region VARCHAR(100) DEFAULT NULL, subregion VARCHAR(100) DEFAULT NULL, district VARCHAR(100) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
  CREATE TABLE search (id INT UNSIGNED AUTO_INCREMENT NOT NULL, dateSearch DATETIME NOT NULL, errors LONGTEXT DEFAULT NULL, resultsCount INT UNSIGNED NOT NULL, url VARCHAR(255) NOT NULL, idFlatFilter INT UNSIGNED DEFAULT NULL, idHouseFilter INT UNSIGNED DEFAULT NULL, idGroundFilter INT UNSIGNED DEFAULT NULL, INDEX IDX_B4F0DBA7CA1CDF8E (idFlatFilter), INDEX IDX_B4F0DBA769EEEE37 (idHouseFilter), INDEX IDX_B4F0DBA73625F4BB (idGroundFilter), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
  CREATE TABLE flat_search_results (search_id INT UNSIGNED NOT NULL, flat_id INT UNSIGNED NOT NULL, INDEX IDX_31A6DF2F650760A9 (search_id), INDEX IDX_31A6DF2FD3331C94 (flat_id), PRIMARY KEY(search_id, flat_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
  CREATE TABLE house_search_results (search_id INT UNSIGNED NOT NULL, house_id INT UNSIGNED NOT NULL, INDEX IDX_D565D4FF650760A9 (search_id), INDEX IDX_D565D4FF6BB74515 (house_id), PRIMARY KEY(search_id, house_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
  CREATE TABLE ground_search_results (search_id INT UNSIGNED NOT NULL, ground_id INT UNSIGNED NOT NULL, INDEX IDX_8D2EC46D650760A9 (search_id), INDEX IDX_8D2EC46D1D297B0A (ground_id), PRIMARY KEY(search_id, ground_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
  ALTER TABLE search ADD CONSTRAINT FK_B4F0DBA7CA1CDF8E FOREIGN KEY (idFlatFilter) REFERENCES filters_flat_filter (idFlatFilter);
  ALTER TABLE search ADD CONSTRAINT FK_B4F0DBA769EEEE37 FOREIGN KEY (idHouseFilter) REFERENCES filters_house_filter (idHouseFilter);
  ALTER TABLE search ADD CONSTRAINT FK_B4F0DBA73625F4BB FOREIGN KEY (idGroundFilter) REFERENCES filters_ground_filter (idGroundFilter);
  ALTER TABLE flat_search_results ADD CONSTRAINT FK_31A6DF2F650760A9 FOREIGN KEY (search_id) REFERENCES search (id) ON DELETE CASCADE;
  ALTER TABLE flat_search_results ADD CONSTRAINT FK_31A6DF2FD3331C94 FOREIGN KEY (flat_id) REFERENCES flat (id) ON DELETE CASCADE;
  ALTER TABLE house_search_results ADD CONSTRAINT FK_D565D4FF650760A9 FOREIGN KEY (search_id) REFERENCES search (id) ON DELETE CASCADE;
  ALTER TABLE house_search_results ADD CONSTRAINT FK_D565D4FF6BB74515 FOREIGN KEY (house_id) REFERENCES house (id) ON DELETE CASCADE;
  ALTER TABLE ground_search_results ADD CONSTRAINT FK_8D2EC46D650760A9 FOREIGN KEY (search_id) REFERENCES search (id) ON DELETE CASCADE;
  ALTER TABLE ground_search_results ADD CONSTRAINT FK_8D2EC46D1D297B0A FOREIGN KEY (ground_id) REFERENCES ground (id) ON DELETE CASCADE;
  