From c2afd7f1f20008c279ddf1760f40d2e7213a9a91 Mon Sep 17 00:00:00 2001 From: samukhin <47834890+samukhin@users.noreply.github.com> Date: Fri, 14 May 2021 19:06:35 +0300 Subject: [PATCH] Add Docker (#77) --- Dockerfile | 82 +++++++ Web/Presenters/NotesPresenter.php | 2 +- .../Docker|Podman/AlmaLinux/Dockerfile | 85 ++++++++ .../automated/Docker|Podman/Centos/Dockerfile | 85 ++++++++ .../automated/Docker|Podman/Fedora/Dockerfile | 83 +++++++ install/automated/Docker|Podman/Readme.md | 1 + install/automated/common/02-rewrite.conf | 1 + install/automated/common/10-openvk.conf | 13 ++ install/automated/common/autoexec | 8 + install/automated/common/create_db.service | 10 + install/init-static-db.sql | 205 ++++++++++-------- openvk-example.yml | 6 +- 12 files changed, 481 insertions(+), 100 deletions(-) create mode 100644 Dockerfile create mode 100644 install/automated/Docker|Podman/AlmaLinux/Dockerfile create mode 100644 install/automated/Docker|Podman/Centos/Dockerfile create mode 100644 install/automated/Docker|Podman/Fedora/Dockerfile create mode 100644 install/automated/Docker|Podman/Readme.md create mode 100644 install/automated/common/02-rewrite.conf create mode 100644 install/automated/common/10-openvk.conf create mode 100644 install/automated/common/autoexec create mode 100644 install/automated/common/create_db.service diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..35954002 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,82 @@ +FROM fedora:33 + +#update and install httpd +RUN dnf -y update && dnf -y autoremove && dnf install -y httpd + +#Let's install Remi repos for PHP 7.4: +RUN dnf -y install https://rpms.remirepo.net/fedora/remi-release-$(rpm -E %fedora).rpm + +#Then enable modules that we need: +RUN dnf -y module enable php:remi-7.4 && \ +dnf -y module enable nodejs:14 + +#And install dependencies: +RUN dnf -y install php php-cli php-common unzip php-zip php-yaml php-gd php-pdo_mysql nodejs git + +#Don't forget about Yarn and Composer: +RUN npm i -g yarn && \ +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ +php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot && \ +rm composer-setup.php + +#We will use Mariadb for DB: +RUN dnf -y install mysql mysql-server && \ +systemctl enable mariadb && \ +echo 'skip-grant-tables' >> /etc/my.cnf + +#Additionally, you can install ffmpeg for processing videos. +#You will need to use RPMFusion repo to install it: +RUN dnf -y install --nogpgcheck https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm && \ +dnf -y install --nogpgcheck https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm + +#Then install SDL2 and ffmpeg: +RUN dnf -y install --nogpgcheck SDL2 ffmpeg + +#Install Chandler and OpenVk/Capcha-extention in /opt: +RUN cd /opt && \ +git clone https://github.com/samukhin/chandler.git && \ +cd chandler/ && \ +composer2 install && \ +mv chandler-example.yml chandler.yml && \ +cd extensions/available/ && \ +git clone https://github.com/samukhin/commitcaptcha.git && \ +cd commitcaptcha/ && \ +composer2 install && \ +cd .. && \ +git clone https://github.com/samukhin/openvk.git && \ +cd openvk/ && \ +composer2 install && \ +cd Web/static/js && \ +yarn install && \ +cd ../../../ && \ +mv openvk-example.yml openvk.yml && \ +ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha && \ +ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk + +#Create database +RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/create_db.service /etc/systemd/system/ && \ +chmod 644 /etc/systemd/system/create_db.service && \ +chmod 777 /opt/chandler/extensions/available/openvk/install/automated/common/autoexec && \ +systemctl enable create_db + +#Make the user apache owner of the chandler folder: +RUN cd /opt && \ +chown -R apache: chandler/ + +#Now let's create config file /etc/httpd/conf.d/10-openvk.conf and +#Also enable rewrite_module by creating /etc/httpd/conf.modules.d/02-rewrite.conf +RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/10-openvk.conf /etc/httpd/conf.d/ && \ +cp /opt/chandler/extensions/available/openvk/install/automated/common/02-rewrite.conf /etc/httpd/conf.modules.d/ + +#Make directory for OpenVK logs and make the user apache owner of it: +RUN mkdir /var/log/openvk && \ +chown apache: /var/log/openvk/ + +#And start Apache: +#RUN systemctl enable httpd + +#For login +RUN dnf -y install passwd && passwd -d root + +#Start systemd +CMD ["/sbin/init"] diff --git a/Web/Presenters/NotesPresenter.php b/Web/Presenters/NotesPresenter.php index 7dba6c65..8c921edb 100644 --- a/Web/Presenters/NotesPresenter.php +++ b/Web/Presenters/NotesPresenter.php @@ -20,7 +20,7 @@ final class NotesPresenter extends OpenVKPresenter $user = (new Users)->get($owner); if(!$user) $this->notFound(); - $this->template->notes = $this->notes->getUserNotes($user, $this->queryParam("p") ?? 1); + $this->template->notes = $this->notes->getUserNotes($user, (int)($this->queryParam("p") ?? 1)); $this->template->count = $this->notes->getUserNotesCount($user); $this->template->owner = $user; $this->template->paginatorConf = (object) [ diff --git a/install/automated/Docker|Podman/AlmaLinux/Dockerfile b/install/automated/Docker|Podman/AlmaLinux/Dockerfile new file mode 100644 index 00000000..e79de2c5 --- /dev/null +++ b/install/automated/Docker|Podman/AlmaLinux/Dockerfile @@ -0,0 +1,85 @@ +#From https://gist.github.com/WerySkok/77f9c9ec134e98b0fef2b63655ba13d2 instruction +FROM almalinux/almalinux:8 + +#update and install httpd +RUN dnf -y update && dnf -y autoremove && dnf install -y httpd + +#Let's install EPEL and Remi repos for PHP 7.4: +RUN dnf -y install epel-release && \ +dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm + +#Then enable modules that we need: +RUN dnf -y module enable php:remi-7.4 && \ +dnf -y module enable nodejs:14 + +#And install dependencies: +RUN dnf -y install php php-cli php-common unzip php-zip php-yaml php-gd php-pdo_mysql nodejs git + +#Don't forget about Yarn and Composer: +RUN npm i -g yarn && \ +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ +php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot && \ +rm composer-setup.php + +#We will use Percona Server for DB: +RUN dnf -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm && \ +percona-release setup -y ps80 && \ +dnf -y install percona-server-server percona-toolkit && \ +systemctl enable mysqld && \ +echo 'skip-grant-tables' >> /etc/my.cnf + +#Additionally, you can install ffmpeg for processing videos. +#You will need to use RPMFusion repo to install it: +RUN dnf -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm && \ +dnf -y install --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm + +#Then install SDL2 and ffmpeg: +RUN dnf -y localinstall --nogpgcheck https://pkgs.dyn.su/el8/base/x86_64/raven-release-1.0-2.el8.noarch.rpm && \ +dnf -y --enablerepo=epel-testing,raven-extras,raven-multimedia install --nogpgcheck SDL2 && \ +dnf -y install ffmpeg + +#Install Chandler and OpenVk/Capcha-extention in /opt: +RUN cd /opt && \ +git clone https://github.com/samukhin/chandler.git && \ +cd chandler/ && \ +composer2 install && \ +mv chandler-example.yml chandler.yml && \ +cd extensions/available/ && \ +git clone https://github.com/samukhin/commitcaptcha.git && \ +cd commitcaptcha/ && \ +composer2 install && \ +cd .. && \ +git clone https://github.com/samukhin/openvk.git && \ +cd openvk/ && \ +composer2 install && \ +cd Web/static/js && \ +yarn install && \ +cd ../../../ && \ +mv openvk-example.yml openvk.yml && \ +ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha && \ +ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk + +#Create database +RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/create_db.service /etc/systemd/system/ && \ +chmod 644 /etc/systemd/system/create_db.service && \ +chmod 777 /opt/chandler/extensions/available/openvk/install/automated/common/autoexec && \ +systemctl enable create_db + +#Make the user apache owner of the chandler folder: +RUN cd /opt && \ +chown -R apache: chandler/ + +#Now let's create config file /etc/httpd/conf.d/10-openvk.conf and +#Also enable rewrite_module by creating /etc/httpd/conf.modules.d/02-rewrite.conf +RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/10-openvk.conf /etc/httpd/conf.d/ && \ +cp /opt/chandler/extensions/available/openvk/install/automated/common/02-rewrite.conf /etc/httpd/conf.modules.d/ + +#Make directory for OpenVK logs and make the user apache owner of it: +RUN mkdir /var/log/openvk && \ +chown apache: /var/log/openvk/ + +#And start Apache: +#RUN systemctl enable httpd + +#Start systemd +CMD ["/sbin/init"] diff --git a/install/automated/Docker|Podman/Centos/Dockerfile b/install/automated/Docker|Podman/Centos/Dockerfile new file mode 100644 index 00000000..3d65ec0f --- /dev/null +++ b/install/automated/Docker|Podman/Centos/Dockerfile @@ -0,0 +1,85 @@ +#From https://gist.github.com/WerySkok/77f9c9ec134e98b0fef2b63655ba13d2 instruction +FROM centos:8 + +#update and install httpd +RUN dnf -y update && dnf -y autoremove && dnf install -y httpd + +#Let's install EPEL and Remi repos for PHP 7.4: +RUN dnf -y install epel-release && \ +dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm + +#Then enable modules that we need: +RUN dnf -y module enable php:remi-7.4 && \ +dnf -y module enable nodejs:14 + +#And install dependencies: +RUN dnf -y install php php-cli php-common unzip php-zip php-yaml php-gd php-pdo_mysql nodejs git + +#Don't forget about Yarn and Composer: +RUN npm i -g yarn && \ +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ +php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot && \ +rm composer-setup.php + +#We will use Percona Server for DB: +RUN dnf -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm && \ +percona-release setup -y ps80 && \ +dnf -y install percona-server-server percona-toolkit && \ +systemctl enable mysqld && \ +echo 'skip-grant-tables' >> /etc/my.cnf + +#Additionally, you can install ffmpeg for processing videos. +#You will need to use RPMFusion repo to install it: +RUN dnf -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm && \ +dnf -y install --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm + +#Then install SDL2 and ffmpeg: +RUN dnf -y localinstall --nogpgcheck https://pkgs.dyn.su/el8/base/x86_64/raven-release-1.0-2.el8.noarch.rpm && \ +dnf -y --enablerepo=epel-testing,raven-extras,raven-multimedia install --nogpgcheck SDL2 && \ +dnf -y install ffmpeg + +#Install Chandler and OpenVk/Capcha-extention in /opt: +RUN cd /opt && \ +git clone https://github.com/samukhin/chandler.git && \ +cd chandler/ && \ +composer2 install && \ +mv chandler-example.yml chandler.yml && \ +cd extensions/available/ && \ +git clone https://github.com/samukhin/commitcaptcha.git && \ +cd commitcaptcha/ && \ +composer2 install && \ +cd .. && \ +git clone https://github.com/samukhin/openvk.git && \ +cd openvk/ && \ +composer2 install && \ +cd Web/static/js && \ +yarn install && \ +cd ../../../ && \ +mv openvk-example.yml openvk.yml && \ +ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha && \ +ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk + +#Create database +RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/create_db.service /etc/systemd/system/ && \ +chmod 644 /etc/systemd/system/create_db.service && \ +chmod 777 /opt/chandler/extensions/available/openvk/install/automated/common/autoexec && \ +systemctl enable create_db + +#Make the user apache owner of the chandler folder: +RUN cd /opt && \ +chown -R apache: chandler/ + +#Now let's create config file /etc/httpd/conf.d/10-openvk.conf and +#Also enable rewrite_module by creating /etc/httpd/conf.modules.d/02-rewrite.conf +RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/10-openvk.conf /etc/httpd/conf.d/ && \ +cp /opt/chandler/extensions/available/openvk/install/automated/common/02-rewrite.conf /etc/httpd/conf.modules.d/ + +#Make directory for OpenVK logs and make the user apache owner of it: +RUN mkdir /var/log/openvk && \ +chown apache: /var/log/openvk/ + +#And start Apache: +#RUN systemctl enable httpd + +#Start systemd +CMD ["/sbin/init"] diff --git a/install/automated/Docker|Podman/Fedora/Dockerfile b/install/automated/Docker|Podman/Fedora/Dockerfile new file mode 100644 index 00000000..615c75db --- /dev/null +++ b/install/automated/Docker|Podman/Fedora/Dockerfile @@ -0,0 +1,83 @@ +#From https://gist.github.com/WerySkok/77f9c9ec134e98b0fef2b63655ba13d2 instruction +FROM fedora:33 + +#update and install httpd +RUN dnf -y update && dnf -y autoremove && dnf install -y httpd + +#Let's install Remi repos for PHP 7.4: +RUN dnf -y install https://rpms.remirepo.net/fedora/remi-release-$(rpm -E %fedora).rpm + +#Then enable modules that we need: +RUN dnf -y module enable php:remi-7.4 && \ +dnf -y module enable nodejs:14 + +#And install dependencies: +RUN dnf -y install php php-cli php-common unzip php-zip php-yaml php-gd php-pdo_mysql nodejs git + +#Don't forget about Yarn and Composer: +RUN npm i -g yarn && \ +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ +php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot && \ +rm composer-setup.php + +#We will use Mariadb for DB: +RUN dnf -y install mysql mysql-server && \ +systemctl enable mariadb && \ +echo 'skip-grant-tables' >> /etc/my.cnf + +#Additionally, you can install ffmpeg for processing videos. +#You will need to use RPMFusion repo to install it: +RUN dnf -y install --nogpgcheck https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm && \ +dnf -y install --nogpgcheck https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm + +#Then install SDL2 and ffmpeg: +RUN dnf -y install --nogpgcheck SDL2 ffmpeg + +#Install Chandler and OpenVk/Capcha-extention in /opt: +RUN cd /opt && \ +git clone https://github.com/samukhin/chandler.git && \ +cd chandler/ && \ +composer2 install && \ +mv chandler-example.yml chandler.yml && \ +cd extensions/available/ && \ +git clone https://github.com/samukhin/commitcaptcha.git && \ +cd commitcaptcha/ && \ +composer2 install && \ +cd .. && \ +git clone https://github.com/samukhin/openvk.git && \ +cd openvk/ && \ +composer2 install && \ +cd Web/static/js && \ +yarn install && \ +cd ../../../ && \ +mv openvk-example.yml openvk.yml && \ +ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha && \ +ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk + +#Create database +RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/create_db.service /etc/systemd/system/ && \ +chmod 644 /etc/systemd/system/create_db.service && \ +chmod 777 /opt/chandler/extensions/available/openvk/install/automated/common/autoexec && \ +systemctl enable create_db + +#Make the user apache owner of the chandler folder: +RUN cd /opt && \ +chown -R apache: chandler/ + +#Now let's create config file /etc/httpd/conf.d/10-openvk.conf and +#Also enable rewrite_module by creating /etc/httpd/conf.modules.d/02-rewrite.conf +RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/10-openvk.conf /etc/httpd/conf.d/ && \ +cp /opt/chandler/extensions/available/openvk/install/automated/common/02-rewrite.conf /etc/httpd/conf.modules.d/ + +#Make directory for OpenVK logs and make the user apache owner of it: +RUN mkdir /var/log/openvk && \ +chown apache: /var/log/openvk/ + +#And start Apache: +#RUN systemctl enable httpd + +#For login +RUN dnf -y install passwd && passwd -d root + +#Start systemd +CMD ["/sbin/init"] diff --git a/install/automated/Docker|Podman/Readme.md b/install/automated/Docker|Podman/Readme.md new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/install/automated/Docker|Podman/Readme.md @@ -0,0 +1 @@ + diff --git a/install/automated/common/02-rewrite.conf b/install/automated/common/02-rewrite.conf new file mode 100644 index 00000000..fc5eb901 --- /dev/null +++ b/install/automated/common/02-rewrite.conf @@ -0,0 +1 @@ +LoadModule rewrite_module modules/mod_rewrite.so diff --git a/install/automated/common/10-openvk.conf b/install/automated/common/10-openvk.conf new file mode 100644 index 00000000..d842eefd --- /dev/null +++ b/install/automated/common/10-openvk.conf @@ -0,0 +1,13 @@ + + ServerName openvk.local + DocumentRoot /opt/chandler/htdocs + + + AllowOverride All + + Require all granted + + + ErrorLog /var/log/openvk/error.log + CustomLog /var/log/openvk/access.log combinedio + diff --git a/install/automated/common/autoexec b/install/automated/common/autoexec new file mode 100644 index 00000000..c187a483 --- /dev/null +++ b/install/automated/common/autoexec @@ -0,0 +1,8 @@ +cd /opt/chandler && \ +mysql -p'DATABASE_PASSWORD' -e "CREATE DATABASE openvk" && \ +mysql -p'DATABASE_PASSWORD' -e "CREATE DATABASE openvk_eventdb" && \ +mysql -p'DATABASE_PASSWORD' openvk < install/init-db.sql && \ +cd extensions/available/openvk/ && \ +mysql -p'DATABASE_PASSWORD' openvk < install/init-static-db.sql && \ +mysql -p'DATABASE_PASSWORD' openvk_eventdb < install/init-event-db.sql && \ +systemctl enable --now httpd diff --git a/install/automated/common/create_db.service b/install/automated/common/create_db.service new file mode 100644 index 00000000..c5553b43 --- /dev/null +++ b/install/automated/common/create_db.service @@ -0,0 +1,10 @@ +[Unit] +Description=Create MySQL DB +After=mysql.service + +[Service] +Type=exec +ExecStart=/bin/bash /opt/chandler/extensions/available/openvk/install/automated/common/autoexec + +[Install] +WantedBy=multi-user.target diff --git a/install/init-static-db.sql b/install/init-static-db.sql index b26bed56..38160dc7 100644 --- a/install/init-static-db.sql +++ b/install/init-static-db.sql @@ -11,32 +11,32 @@ START TRANSACTION; CREATE TABLE `albums` ( `id` bigint(20) UNSIGNED NOT NULL, `owner` bigint(20) NOT NULL, - `name` varchar(36) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, - `description` longtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `name` varchar(36) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `description` longtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `access_pragma` tinyint(3) UNSIGNED NOT NULL DEFAULT 255, `cover_photo` bigint(20) UNSIGNED DEFAULT NULL, `special_type` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, `created` bigint(20) UNSIGNED NOT NULL, `edited` bigint(20) UNSIGNED DEFAULT NULL, `deleted` tinyint(1) NOT NULL DEFAULT 0 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `album_relations` ( `collection` bigint(20) UNSIGNED NOT NULL, `media` bigint(20) UNSIGNED NOT NULL, `index` bigint(20) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `api_tokens` ( `id` bigint(20) UNSIGNED NOT NULL, `user` bigint(20) NOT NULL, - `secret` char(72) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `secret` char(72) COLLATE utf8mb4_unicode_520_ci NOT NULL, `deleted` bit(1) NOT NULL DEFAULT b'0' -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `approval_queue` ( `id` bigint(20) UNSIGNED NOT NULL, - `model` varchar(128) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `model` varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL, `target` bigint(20) NOT NULL, `author` bigint(20) UNSIGNED NOT NULL, `assignee` bigint(20) UNSIGNED DEFAULT NULL, @@ -44,15 +44,15 @@ CREATE TABLE `approval_queue` ( `created` bigint(20) UNSIGNED NOT NULL, `updated` bigint(20) UNSIGNED NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT 0 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `attachments` ( - `attachable_type` varchar(64) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `attachable_type` varchar(64) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `attachable_id` bigint(20) UNSIGNED DEFAULT NULL, - `target_type` varchar(64) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `target_type` varchar(64) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `target_id` bigint(20) UNSIGNED DEFAULT NULL, `index` bigint(20) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `audios` ( `id` bigint(20) UNSIGNED NOT NULL, @@ -60,34 +60,34 @@ CREATE TABLE `audios` ( `virtual_id` bigint(20) UNSIGNED NOT NULL, `created` bigint(20) UNSIGNED NOT NULL, `edited` bigint(20) UNSIGNED DEFAULT NULL, - `hash` char(128) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `hash` char(128) COLLATE utf8mb4_unicode_520_ci NOT NULL, `deleted` tinyint(4) DEFAULT 0, - `name` varchar(190) COLLATE utf8mb4_unicode_nopad_ci NOT NULL DEFAULT '(no name)', - `performer` varchar(190) COLLATE utf8mb4_unicode_nopad_ci NOT NULL DEFAULT 'Unknown', - `genre` varchar(190) COLLATE utf8mb4_unicode_nopad_ci NOT NULL DEFAULT 'K-POP', - `lyrics` longtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `name` varchar(190) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '(no name)', + `performer` varchar(190) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'Unknown', + `genre` varchar(190) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'K-POP', + `lyrics` longtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `explicit` tinyint(4) NOT NULL DEFAULT 0 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `audio_relations` ( `user` bigint(20) UNSIGNED NOT NULL, `audio` bigint(20) UNSIGNED NOT NULL, `index` bigint(20) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `comments` ( `id` bigint(20) UNSIGNED NOT NULL, `owner` bigint(20) NOT NULL, - `model` varchar(128) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `model` varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL, `target` bigint(20) UNSIGNED NOT NULL, `created` bigint(20) UNSIGNED NOT NULL, `edited` bigint(20) UNSIGNED DEFAULT NULL, - `content` longtext COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `content` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, `flags` tinyint(3) UNSIGNED DEFAULT NULL, `ad` tinyint(1) NOT NULL DEFAULT 0, `deleted` tinyint(1) DEFAULT 0, `virtual_id` bigint(20) DEFAULT 0 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `conv_sockets` ( `id` bigint(20) UNSIGNED NOT NULL, @@ -96,32 +96,32 @@ CREATE TABLE `conv_sockets` ( `destination` bigint(20) UNSIGNED NOT NULL, `open` bit(1) NOT NULL DEFAULT b'1', `visible` bit(1) NOT NULL DEFAULT b'1' -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `event_turnouts` ( `user` bigint(20) UNSIGNED NOT NULL, `event` bigint(20) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `groups` ( `id` bigint(20) UNSIGNED NOT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `about` mediumtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `name` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `about` mediumtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `owner` bigint(20) UNSIGNED DEFAULT NULL, - `shortcode` varchar(36) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `shortcode` varchar(36) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `verified` tinyint(1) NOT NULL DEFAULT 0, `type` int(10) UNSIGNED DEFAULT 1, `closed` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, - `block_reason` text COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `block_reason` text COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `wall` int(11) NOT NULL DEFAULT 1 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `group_coadmins` ( `user` bigint(20) UNSIGNED NOT NULL, `club` bigint(20) UNSIGNED NOT NULL, - `comment` varchar(36) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `comment` varchar(36) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `id` bigint(20) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `ip` ( `id` bigint(20) UNSIGNED NOT NULL, @@ -132,28 +132,28 @@ CREATE TABLE `ip` ( `rate_limit_violation_counter_start` bigint(20) UNSIGNED NOT NULL DEFAULT 0, `rate_limit_violation_counter` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, `banned` tinyint(1) NOT NULL DEFAULT 0 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `likes` ( `origin` bigint(20) UNSIGNED NOT NULL, - `model` varchar(128) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `model` varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL, `target` bigint(20) NOT NULL, `index` bigint(20) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `messages` ( `id` bigint(20) NOT NULL, - `sender_type` varchar(64) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `sender_type` varchar(64) COLLATE utf8mb4_unicode_520_ci NOT NULL, `sender_id` bigint(20) UNSIGNED NOT NULL, - `recipient_type` varchar(64) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `recipient_type` varchar(64) COLLATE utf8mb4_unicode_520_ci NOT NULL, `recipient_id` bigint(20) UNSIGNED NOT NULL, - `content` longtext COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `content` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, `created` bigint(20) NOT NULL, `edited` bigint(20) DEFAULT NULL, `ad` tinyint(1) NOT NULL DEFAULT 0, `deleted` tinyint(1) NOT NULL DEFAULT 0, `unread` tinyint(1) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `msg_descriptors` ( `message` bigint(20) UNSIGNED NOT NULL, @@ -162,7 +162,7 @@ CREATE TABLE `msg_descriptors` ( `ack_time` bigint(20) UNSIGNED DEFAULT NULL, `visible` tinyint(3) UNSIGNED NOT NULL DEFAULT 1, `index` bigint(20) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `notes` ( `id` bigint(20) UNSIGNED NOT NULL, @@ -170,24 +170,24 @@ CREATE TABLE `notes` ( `virtual_id` bigint(20) NOT NULL, `created` bigint(20) NOT NULL, `edited` bigint(20) DEFAULT NULL, - `name` varchar(256) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, - `source` longtext COLLATE utf8mb4_unicode_nopad_ci NOT NULL, - `cached_content` longtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `name` varchar(256) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `source` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, + `cached_content` longtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `deleted` tinyint(4) NOT NULL DEFAULT 0 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `number_verification` ( `user` bigint(20) UNSIGNED NOT NULL, - `number` varchar(48) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `number` varchar(48) COLLATE utf8mb4_unicode_520_ci NOT NULL, `code` mediumint(9) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `password_resets` ( `id` bigint(20) UNSIGNED NOT NULL, `profile` bigint(20) UNSIGNED NOT NULL, - `key` char(64) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `key` char(64) COLLATE utf8mb4_unicode_520_ci NOT NULL, `timestamp` bigint(20) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `photos` ( `id` bigint(20) UNSIGNED NOT NULL, @@ -195,10 +195,10 @@ CREATE TABLE `photos` ( `virtual_id` bigint(20) NOT NULL, `created` bigint(20) UNSIGNED NOT NULL, `edited` bigint(20) UNSIGNED DEFAULT NULL, - `hash` char(128) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `hash` char(128) COLLATE utf8mb4_unicode_520_ci NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT 0, - `description` longtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; + `description` longtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `posts` ( `id` bigint(20) UNSIGNED NOT NULL, @@ -207,51 +207,51 @@ CREATE TABLE `posts` ( `virtual_id` bigint(20) UNSIGNED NOT NULL, `created` bigint(20) UNSIGNED NOT NULL, `edited` bigint(20) UNSIGNED DEFAULT NULL, - `content` longtext COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `content` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, `flags` tinyint(3) UNSIGNED DEFAULT NULL, `nsfw` tinyint(1) NOT NULL DEFAULT 0, `ad` tinyint(1) NOT NULL DEFAULT 0, `deleted` tinyint(1) DEFAULT 0 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `profiles` ( `id` bigint(20) UNSIGNED NOT NULL, - `user` varchar(36) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, - `first_name` varchar(50) COLLATE utf8mb4_unicode_nopad_ci NOT NULL DEFAULT 'Jane', - `last_name` varchar(50) COLLATE utf8mb4_unicode_nopad_ci NOT NULL DEFAULT 'Doe', - `pseudo` varchar(50) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `info` longtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `about` longtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `status` varchar(255) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `user` varchar(36) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `first_name` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'Jane', + `last_name` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'Doe', + `pseudo` varchar(50) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `info` longtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `about` longtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `status` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `privacy` bigint(20) UNSIGNED NOT NULL DEFAULT 1099511627775, `left_menu` bigint(20) UNSIGNED NOT NULL DEFAULT 1099511627775, `sex` tinyint(1) NOT NULL DEFAULT 1, `type` tinyint(4) NOT NULL DEFAULT 0, - `phone` varchar(36) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `email` varchar(90) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `phone` varchar(36) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `email` varchar(90) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `coins` bigint(20) UNSIGNED NOT NULL DEFAULT 0, `since` datetime NOT NULL, - `block_reason` text COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `block_reason` text COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `verified` tinyint(1) NOT NULL DEFAULT 0, `reputation` bigint(20) NOT NULL DEFAULT 1000, - `shortcode` varchar(36) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `registering_ip` varchar(256) COLLATE utf8mb4_unicode_nopad_ci NOT NULL DEFAULT '127.0.0.1', + `shortcode` varchar(36) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `registering_ip` varchar(256) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '127.0.0.1', `online` bigint(20) UNSIGNED NOT NULL DEFAULT 0, `birthday` bigint(20) DEFAULT 0, - `hometown` varchar(60) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `hometown` varchar(60) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `polit_views` int(11) DEFAULT 0, `marital_status` int(11) DEFAULT 0, - `email_contact` varchar(128) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `telegram` varchar(32) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `interests` mediumtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `fav_music` mediumtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `fav_films` mediumtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `fav_shows` mediumtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `fav_books` mediumtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `fav_quote` mediumtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `city` varchar(60) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `address` varchar(60) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `style` varchar(36) COLLATE utf8mb4_unicode_nopad_ci NOT NULL DEFAULT 'ovk', + `email_contact` varchar(128) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `telegram` varchar(32) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `interests` mediumtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `fav_music` mediumtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `fav_films` mediumtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `fav_shows` mediumtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `fav_books` mediumtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `fav_quote` mediumtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `city` varchar(60) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `address` varchar(60) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `style` varchar(36) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'ovk', `style_avatar` int(11) DEFAULT 0, `show_rating` tinyint(1) DEFAULT 1, `milkshake` tinyint(1) NOT NULL DEFAULT 0, @@ -259,34 +259,47 @@ CREATE TABLE `profiles` ( `notification_offset` bigint(20) UNSIGNED DEFAULT 0, `deleted` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, `microblog` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `stickerpacks` ( `id` bigint(20) UNSIGNED NOT NULL, - `slug` varchar(36) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `name` varchar(64) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, - `description` longtext COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `slug` varchar(36) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `name` varchar(64) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `description` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, `sold` tinyint(4) NOT NULL DEFAULT 0, `price` bigint(20) UNSIGNED DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `stickers` ( `id` bigint(20) UNSIGNED NOT NULL, - `hash` char(128) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, - `emojis` longtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; + `hash` char(128) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `emojis` longtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `sticker_relations` ( `sticker` bigint(20) UNSIGNED NOT NULL, `pack` bigint(20) UNSIGNED NOT NULL, `index` bigint(20) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `subscriptions` ( `follower` bigint(20) UNSIGNED NOT NULL, - `model` longtext COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `model` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, `target` bigint(20) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; + +CREATE TABLE subscriptions_new ( + `handle` bigint(20) UNSIGNED NOT NULL, + `initiator` bigint(20) UNSIGNED NOT NULL, + `targetModel` varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL, + `targetId` bigint(20) NOT NULL, + `targetWallHandle` bigint(20) NOT NULL, + `shortStatus` tinyint(3) UNSIGNED NOT NULL DEFAULT 1, + `detailedStatus` tinyint(3) UNSIGNED NOT NULL DEFAULT 1, + `listName` varchar(64) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `created` bigint(20) UNSIGNED NOT NULL, + `updated` bigint(20) UNSIGNED NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE subscriptions_new ( `handle` bigint(20) UNSIGNED NOT NULL, @@ -306,20 +319,20 @@ CREATE TABLE `tickets` ( `type` bigint(20) UNSIGNED NOT NULL, `deleted` tinyint(4) NOT NULL DEFAULT 0, `user_id` bigint(20) UNSIGNED NOT NULL, - `name` text COLLATE utf8mb4_unicode_nopad_ci NOT NULL, - `text` longtext COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `name` text COLLATE utf8mb4_unicode_520_ci NOT NULL, + `text` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, `created` bigint(20) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `tickets_comments` ( `id` int(11) NOT NULL, `user_id` bigint(20) UNSIGNED NOT NULL, `user_type` int(11) NOT NULL DEFAULT 0, - `text` longtext COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + `text` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, `created` int(11) NOT NULL, `deleted` tinyint(4) NOT NULL DEFAULT 0, `ticket_id` bigint(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; CREATE TABLE `videos` ( `id` bigint(20) UNSIGNED NOT NULL, @@ -327,12 +340,12 @@ CREATE TABLE `videos` ( `virtual_id` bigint(20) NOT NULL, `created` bigint(20) UNSIGNED NOT NULL, `edited` bigint(20) UNSIGNED DEFAULT NULL, - `hash` char(128) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `link` varchar(64) COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, + `hash` char(128) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `link` varchar(64) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `deleted` tinyint(1) NOT NULL DEFAULT 0, - `description` longtext COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL, - `name` varchar(64) COLLATE utf8mb4_unicode_nopad_ci NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; + `description` longtext COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, + `name` varchar(64) COLLATE utf8mb4_unicode_520_ci NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; ALTER TABLE `albums` diff --git a/openvk-example.yml b/openvk-example.yml index 825b2802..9698e405 100644 --- a/openvk-example.yml +++ b/openvk-example.yml @@ -48,10 +48,10 @@ openvk: smsc: enable: false client: "" - secret: "" + secret: "SECRET_KEY_HERE" eventDB: enable: false # Better enable this database: dsn: "mysql:unix_socket=/tmp/mysql.sock;dbname=openvk-eventdb" - user: "" - password: "" + user: "root" + password: "DATABASE_PASSWORD"