Installation failed to create the core tables | Installing Revive Adserver 5.2.0 - mysqli

I am installing revive ad server on Ubuntu 20.4 which is having MySQL Version 8.0.23. The Log I got from file /var/debug.log is
[Last executed query: CREATE TABLE `bv_banners` (`bannerid` MEDIUMINT(9) AUTO_INCREMENT NOT NULL, `campaignid` MEDIUMINT(9) DEFAULT 0 NOT NULL, `contenttype` ENUM('gif','jpeg','png','html','swf','dcr','rpm','mov','txt') DEFAULT 'gif' NOT NULL, `pluginversion` MEDIUMINT(9) DEFAULT 0 NOT NULL, `storagetype` ENUM('sql','web','url','html','network','txt') DEFAULT 'sql' NOT NULL, `filename` VARCHAR(255) DEFAULT '' NOT NULL, `imageurl` VARCHAR(255) DEFAULT '' NOT NULL, `htmltemplate` MEDIUMTEXT NOT NULL, `htmlcache` MEDIUMTEXT NOT NULL, `width` SMALLINT(6) DEFAULT 0 NOT NULL, `height` SMALLINT(6) DEFAULT 0 NOT NULL, `weight` TINYINT(4) DEFAULT 1 NOT NULL, `seq` TINYINT(4) DEFAULT 0 NOT NULL, `target` VARCHAR(16) DEFAULT '' NOT NULL, `url` TEXT NOT NULL, `alt` VARCHAR(255) DEFAULT '' NOT NULL, `statustext` VARCHAR(255) DEFAULT '' NOT NULL, `bannertext` TEXT NOT NULL, `description` VARCHAR(255) DEFAULT '' NOT NULL, `adserver` VARCHAR(255) DEFAULT '' NOT NULL, `block` INT(11) DEFAULT 0 NOT NULL, `capping` INT(11) DEFAULT 0 NOT NULL, `session_capping` INT(11) DEFAULT 0 NOT NULL, `compiledlimitation` TEXT NOT NULL, `acl_plugins` TEXT DEFAULT NULL, `append` TEXT NOT NULL, `bannertype` TINYINT(4) DEFAULT 0 NOT NULL, `alt_filename` VARCHAR(255) DEFAULT '' NOT NULL, `alt_imageurl` VARCHAR(255) DEFAULT '' NOT NULL, `alt_contenttype` ENUM('gif','jpeg','png') DEFAULT 'gif' NOT NULL, `comments` TEXT DEFAULT NULL, `updated` DATETIME NOT NULL, `acls_updated` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL, `keyword` VARCHAR(255) DEFAULT '' NOT NULL, `transparent` TINYINT(1) DEFAULT 0 NOT NULL, `parameters` TEXT DEFAULT NULL, `status` INT(11) DEFAULT 0 NOT NULL, `ext_bannertype` VARCHAR(255) DEFAULT NULL, `prepend` TEXT NOT NULL, `iframe_friendly` TINYINT(1) DEFAULT 1 NOT NULL, PRIMARY KEY (bannerid)) ENGINE = INNODB]
[Native message: Invalid default value for 'acls_updated']
I got to know adserver is not officially supporting mysql version 8. But some people are able to run fine. I want to know how.
Here is the refrence I got
https://github.com/revive-adserver/revive-adserver/issues/1048
I want to run this.
Thanks in advance.

set sql_mode='40'' to sql_mode=''
in 5 files;
lib/OA/DB.php
lib/OA/DaL/Delivery/mysql.php
lib/OA/Dal/Delivery/mysqli.php
lib/OA/Upgrade/DB_Upgrade.php
lib/OA/Upgrade/Upgrade.php
and use table type INNODB
This trick works for me. I am calling this as a trick because it is not officially supported.
I got solution from github.
Here is the refrence
https://github.com/revive-adserver/revive-adserver/issues/1048

Related

Why do I have an empty “Searchable attributes” after import with 'algolia/scout-extended'?

In a Laravel 9 application, I have algolia/scout-extended 2.0.
Running on my local OS command
php artisan scout:optimize
I got several files like config/scout-search-pages.php, and I modified one of them:
'searchableAttributes' => [
'page_title',
'page_slug',
'page_content',
'page_content_shortly',
'page_author_name',
'page_author_email',
'page_price',
'page_categories',
'page_created_at',
],
'customRanking' => ['asc(page_price)', 'desc(page_created_at)'],
And clearing the cache I run an import and after that I see a set of rows/columns I expected: https://prnt.sc/Ew0BdaH3dvON
But on the “Configuration” tab I see an empty “Searchable attributes” list, and I have to add fields manually.
I expected that these fields must be filled automatically from “searchableAttributes” option,
but not.
After I added more columns at “Add a Searchable Attribute” I see “unordered/unordered” option for fields.
How does it work and which option do I have to select?
The source table on MySQL 8 side has this structure:
CREATE TABLE `search_pages` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`page_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`page_slug` varchar(260) COLLATE utf8mb4_unicode_ci NOT NULL,
`page_content` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`page_content_shortly` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`page_author_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`page_author_email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`page_price` decimal(9,2) NOT NULL DEFAULT '0.00',
`page_categories` json DEFAULT NULL,
`page_created_at` timestamp NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `search_pages_page_slug_unique` (`page_slug`),
KEY `search_pages_page_author_name_page_title_index` (`page_author_name`,`page_title`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Postgresql: How to use ENUM datatype?

I am new to Postgresql, I am trying to create this table actually just following a similar mysql table. But I keep getting this error for ENUM()
Below is the query for creating the table structure:
CREATE TABLE IF NOT EXISTS gkb_users (
id bigint NOT NULL,
userid character varying(50) NOT NULL DEFAULT '',
password character varying(50) NOT NULL DEFAULT '',
firstname text NOT NULL,
middlename text NOT NULL,
lastname text NOT NULL,
email character varying(100) NOT NULL DEFAULT '',
gender enum('Male','Female') NOT NULL,
dob date NOT NULL,
mobile character varying(10) NOT NULL DEFAULT '',
telephone character varying(15) NOT NULL DEFAULT '',
city character varying(50) NOT NULL DEFAULT '',
address text NOT NULL,
shippingaddress text NOT NULL,
PIN character varying(255) NOT NULL,
shipping_PIN character varying(255) NOT NULL,
area character varying(255) NOT NULL,
shipping_area character varying(255) NOT NULL,
previouscart text NOT NULL,
updatedon timestamp(0) NOT NULL,
is_deleted enum('0','1') NOT NULL
);
Any help will be greatly appreciated. Thanks
ENUM is a user-defined datatype. You can use CREATE TYPE syntax to create your enum and then use it in the schema to create table.
CREATE TYPE your_enum2 AS ENUM('0','1');
CREATE TYPE your_enum1 AS ENUM('male','female');
Followed by the CREATE TABLE statement,
CREATE TABLE IF NOT EXISTS gkb_users (
id bigint NOT NULL,
userid character varying(50) NOT NULL DEFAULT '',
password character varying(50) NOT NULL DEFAULT '',
firstname text NOT NULL,
middlename text NOT NULL,
lastname text NOT NULL,
email character varying(100) NOT NULL DEFAULT '',
gender your_enum1 NOT NULL,
dob date NOT NULL,
mobile character varying(10) NOT NULL DEFAULT '',
telephone character varying(15) NOT NULL DEFAULT '',
city character varying(50) NOT NULL DEFAULT '',
address text NOT NULL,
shippingaddress text NOT NULL,
PIN character varying(255) NOT NULL,
shipping_PIN character varying(255) NOT NULL,
area character varying(255) NOT NULL,
shipping_area character varying(255) NOT NULL,
previouscart text NOT NULL,
updatedon timestamp(0) NOT NULL,
is_deleted your_enum2 NOT NULL
);
Refer postgresql docs https://www.postgresql.org/docs/current/static/datatype-enum.html for more information on enum creation and usage.
You don't need an enum for this (and I personally think one never needs an enum - but that's off topic).
You should either implement this as a check constraint:
CREATE TABLE IF NOT EXISTS gkb_users
(
id bigint NOT NULL,
userid varchar(50) NOT NULL DEFAULT '',
password varchar(50) NOT NULL DEFAULT '',
firstname text NOT NULL,
middlename text NOT NULL,
lastname text NOT NULL,
email varchar(100) NOT NULL DEFAULT '',
gender text NOT NULL,
dob date NOT NULL,
mobile varchar(10) NOT NULL DEFAULT '',
telephone varchar(15) NOT NULL DEFAULT '',
city varchar(50) NOT NULL DEFAULT '',
address text NOT NULL,
shippingaddress text NOT NULL,
pin varchar(255) NOT NULL,
shipping_pin varchar(255) NOT NULL,
area varchar(255) NOT NULL,
shipping_area varchar(255) NOT NULL,
previouscart text NOT NULL,
updatedon timestamp(0) NOT NULL,
is_deleted integer NOT NULL,
constraint check_gender check (gender in ('Male', 'Female')),
constraint check_deleted flag check (is_deleted in (0,1))
)
However, for is_delete should better be a proper boolean column - then you also don't need a check constraint for that column.
Postgres - like many other DBMS - is case sensitive when comparing strings. So with the above constraint you won't be able to store 'male' into the gender column.
Unrelated but: if you were assuming that varchar(255) has some magic performance benefits compared to e.g. varchar(300) then you are wrong. The maximum length of a varchar column does not influence the performance or the space requirements when storing the values.

Extension installation prefill table

Hi I want to add some data during extension installation ...
I've added an SQL statement after table creation but that will be ignored during installation.
#
# Insert für start einstellungen
#
INSERT INTO tx_rere_domain_model_intervall (type,aktuell) VALUES ('studienhalbjahr','WS14/15');
This code is directly after the Create Statement of tx_rere_domain_model_intervall
UPDATE:
# TYPO3 Extension Manager dump 1.1
#
#--------------------------------------------------------
#
# Table structure for table 'tx_rere_domain_model_interval'
#
DROP TABLE IF EXISTS tx_rere_domain_model_intervall;
CREATE TABLE tx_rere_domain_model_intervall (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
type varchar(255) DEFAULT '' NOT NULL,
aktuell varchar(255) DEFAULT '' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
starttime int(11) unsigned DEFAULT '0' NOT NULL,
endtime int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3ver_id int(11) DEFAULT '0' NOT NULL,
t3ver_wsid int(11) DEFAULT '0' NOT NULL,
t3ver_label varchar(255) DEFAULT '' NOT NULL,
t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
t3ver_stage int(11) DEFAULT '0' NOT NULL,
t3ver_count int(11) DEFAULT '0' NOT NULL,
t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
t3ver_move_id int(11) DEFAULT '0' NOT NULL,
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l10n_parent int(11) DEFAULT '0' NOT NULL,
l10n_diffsource mediumblob,
PRIMARY KEY (uid),
KEY parent (pid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY language (l10n_parent,sys_language_uid)
);
INSERT INTO tx_rere_domain_model_intervall (type,aktuell) VALUES ('studienhalbjahr','WS14/15');
To include static data with your extension, you must place the SQL INSERT statements in a file named ext_tables_static+adt.sql, which should be located in the root directory of your extension.
The content of this file will be imported to the TYPO3 Database when importing the extension with the extension manager.
For a working example please refer to the static_info_tables extension.
For me the ext_tables_static+adt.sql dosn't work ... I've done a workarround with prefilling the table if the table is empty!
When working with ext_tables_static+adt.sql, remember to delete the row for your plugin in the table sys_registry if the import doesn't work.
Typo3 sets a flag after the import has been done once and future imports will be ignored.

Base table or view not found: 1146 Table magento

When I try to create an admin_user table on the server I get this error:
Base table or view not found: 1146 Table
The DDL:
CREATE TABLE IF NOT EXISTS `admin_user` (
`user_id` mediumint(9) unsigned NOT NULL AUTO_INCREMENT,
`firstname` varchar(32) NOT NULL DEFAULT '',
`lastname` varchar(32) NOT NULL DEFAULT '',
`email` varchar(128) NOT NULL DEFAULT '',
`username` varchar(40) NOT NULL DEFAULT '',
`password` varchar(40) NOT NULL DEFAULT '',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` datetime DEFAULT NULL,
`logdate` datetime DEFAULT NULL,
`lognum` smallint(5) unsigned NOT NULL DEFAULT '0',
`reload_acl_flag` tinyint(1) NOT NULL DEFAULT '0',
`is_active` tinyint(1) NOT NULL DEFAULT '1',
`extra` text,
PRIMARY KEY (`user_id`),
UNIQUE KEY `UNQ_ADMIN_USER_USERNAME` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
What is wrong?

Multi-table query - get friend updates

SELECT M.msg_id, M.uid_fk, M.message, M.created,
U.fname, U.lname, M.uploads
FROM messages M, users_friends F, users U
WHERE M.uid_fk=F.friendID
and F.userID = '5'
and status='2'
Building a facebook-like wall and want to grab messages(updates) from friends.
The query above returns an empty set, even though I've made sure there are messages from user 5 in the table.
Schema:
CREATE TABLE IF NOT EXISTS `messages` (
`msg_id` int(11) NOT NULL AUTO_INCREMENT,
`message` varchar(200) CHARACTER SET utf8 DEFAULT NULL,
`uid_fk` int(11) DEFAULT NULL,
`ip` varchar(30) DEFAULT NULL,
`created` int(11) DEFAULT '1269249260',
`uploads` varchar(30) DEFAULT NULL,
PRIMARY KEY (`msg_id`),
KEY `uid_fk` (`uid_fk`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=263 ;
CREATE TABLE IF NOT EXISTS `users` (
`fname` varchar(15) NOT NULL,
`lname` varchar(15) NOT NULL,
`userID` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(23) NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(32) NOT NULL,
`DOB` date DEFAULT NULL,
`sex` varchar(1) DEFAULT NULL,
`about` text NOT NULL,
`location` varchar(20) DEFAULT NULL,
`last_login` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_level` int(11) NOT NULL DEFAULT '0',
`profile_image` varchar(200) NOT NULL,
`profile_image_small` varchar(200) NOT NULL,
PRIMARY KEY (`userID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 ;
CREATE TABLE IF NOT EXISTS `users_friends` (
`userID` int(11) NOT NULL,
`friendID` int(11) NOT NULL,
`status` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`userID`,`friendID`),
KEY `fk_users_has_friends_users1` (`userID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
You are single quoting your INT values in the WHERE clause → '5' & '2'.
Also, try JOINs.
SELECT M.msg_id,
M.uid_fk,
M.message,
M.created,
U.fname,
U.lname,
M.uploads
FROM messages M
INNER JOIN users_friends F ON F.friendID = M.uid_fk
AND F.userID = 5
AND F.status = 2
INNER JOIN users U ON U.userID = F.friendID;