Skip to content
Permalink
Browse files

fix: enable real utf-8 for mysql database

  • Loading branch information...
p3k committed Jul 10, 2016
1 parent f27a4cf commit 313833ecce1a612516cb6c7ba30fa20c1a56f52e
Showing with 177 additions and 71 deletions.
  1. +1 −1 db/my.compat/db.properties
  2. +64 −70 db/my.sql
  3. +112 −0 extra/updater/patch-20160709.js
@@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

antville.url = jdbc:mysql://localhost/antville?useUnicode=true&characterEncoding=utf8
antville.url = jdbc:mysql://localhost/antville?useUnicode=true
antville.driver = com.mysql.jdbc.Driver
antville.user = antville
antville.password = antville
134 db/my.sql
@@ -15,8 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

create database if not exists antville character set latin1
collate latin1_general_ci;
create database if not exists antville character set utf8mb4
collate utf8mb4_unicode_ci;

use antville;

@@ -27,15 +27,14 @@ set foreign_key_checks = 0;

create table account (
id int(10) unsigned not null default '0',
name varchar(255) character set utf8 collate utf8_general_ci,
metadata mediumtext,
email varchar(255) character set utf8 collate utf8_general_ci,
status varchar(20),
name varchar(500),
email varchar(500),
status varchar(50),
created datetime,
modified datetime,
primary key (id),
key name (name(20)),
key email (email(20)),
key name (name(191)),
key email (email(191)),
key status (status),
key created (created),
key modified (modified)
@@ -44,7 +43,7 @@ create table account (
create table choice (
id int(10) unsigned not null default '0',
poll_id int(10) unsigned,
title text character set utf8 collate utf8_general_ci,
title text,
created datetime,
modified datetime,
primary key (id),
@@ -53,196 +52,191 @@ create table choice (

create table content (
id int(10) unsigned not null default '0',
prototype varchar(20),
name varchar(255) character set utf8 collate utf8_general_ci,
prototype varchar(50),
name varchar(500),
site_id int(10) unsigned,
story_id int(10) unsigned,
parent_id int(10) unsigned,
parent_type varchar(20),
metadata mediumtext,
status varchar(20),
mode varchar(20),
comment_mode varchar(20),
parent_type varchar(50),
status varchar(50),
mode varchar(50),
comment_mode varchar(50),
requests int(10) unsigned,
created datetime,
creator_id int(10) unsigned,
modified datetime,
modifier_id int(10) unsigned,
primary key (id),
primary key (id),
key story_id (story_id),
key parent_id (parent_id),
key creator_id (creator_id),
key type (site_id,prototype,status,created,modified,id),
key modified (site_id,modified,status,prototype,id)
key type (site_id, prototype, status, created, modified, id),
key modified (site_id, modified, status, prototype,id)
);

create table file (
id int(10) unsigned not null default '0',
prototype varchar(20),
name varchar(255) character set utf8 collate utf8_general_ci,
prototype varchar(50),
name varchar(500),
site_id int(10) unsigned,
parent_id int(10) unsigned,
parent_type varchar(20),
metadata mediumtext,
parent_type varchar(50),
requests int(10) unsigned,
created datetime,
creator_id int(10) unsigned,
modified datetime,
modifier_id int(10) unsigned,
primary key (id),
primary key (id),
key site_id (site_id),
key name (name(20)),
key name (name(191)),
key creator_id (creator_id)
);

create table image (
id int(10) unsigned not null default '0',
name varchar(255) character set utf8 collate utf8_general_ci,
prototype varchar(20),
name varchar(500),
prototype varchar(50),
parent_id int(10) unsigned,
parent_type varchar(20),
metadata mediumtext,
parent_type varchar(50),
created datetime,
creator_id int(10) unsigned,
modified datetime,
modifier_id int(10) unsigned,
primary key (id),
primary key (id),
key creator_id (creator_id),
key type (name,prototype)
key type (name(191), prototype)
);

create table layout (
id int(10) unsigned not null default '0',
site_id int(10) unsigned,
metadata mediumtext,
mode varchar(20),
mode varchar(50),
created datetime,
creator_id int(10) unsigned,
modified datetime,
modifier_id int(10) unsigned,
primary key (id),
primary key (id),
key site_id (site_id)
);

create table log (
id int(10) unsigned not null auto_increment,
context_id int(10) unsigned,
context_type varchar(20),
context_type varchar(50),
referrer text,
action varchar(255) character set utf8 collate utf8_general_ci,
action varchar(500),
created datetime,
creator_id int(10) unsigned,
primary key (id)
primary key (id)
);

create table membership (
id int(10) unsigned not null default '0',
name varchar(255) character set utf8 collate utf8_general_ci,
name varchar(500),
site_id int(10) unsigned,
role varchar(20),
role varchar(50),
created datetime,
creator_id int(10) unsigned,
modified datetime,
modifier_id int(10) unsigned,
primary key (id),
primary key (id),
key site_id (site_id),
key creator_id (creator_id),
key name (name(20))
key name (name(191))
);

#!helma <% #metadata %>

create table metadata (
id int(10) unsigned not null default '0',
parent_id int(10) unsigned,
parent_type varchar(20),
name varchar(255) character set utf8 collate utf8_general_ci,
value mediumtext character set utf8 collate utf8_general_ci,
type varchar(255),
parent_type varchar(50),
name varchar(500),
value mediumtext,
type varchar(500),
primary key (id),
key parent (parent_type, parent_id),
key name (name),
key value (value(255))
key name (name(191)),
key value (value(191))
);

#!helma <% #end_of_metadata %>

create table poll (
id int(10) unsigned not null default '0',
site_id int(10) unsigned,
question text character set utf8 collate utf8_general_ci,
status varchar(20),
question text,
status varchar(50),
closed datetime,
created datetime,
creator_id int(10) unsigned,
modified datetime,
modifier_id int(10) unsigned,
primary key (id),
primary key (id),
key site_id (site_id),
key creator_id (creator_id)
);

create table site (
id int(10) unsigned not null default '0',
name varchar(255) character set utf8 collate utf8_general_ci,
name varchar(500),
layout_id int(10) unsigned,
metadata mediumtext,
status varchar(20),
mode varchar(20),
status varchar(50),
mode varchar(50),
created datetime,
creator_id int(10) unsigned,
modified datetime,
modifier_id int(10) unsigned,
primary key (id),
key name (name(20)),
primary key (id),
key name (name(191)),
key creator_id (creator_id)
);

create table skin (
id int(10) unsigned not null default '0',
name varchar(255) character set utf8 collate utf8_general_ci,
prototype varchar(30),
name varchar(500),
prototype varchar(50),
source mediumtext,
layout_id int(10) unsigned,
created datetime,
creator_id int(10) unsigned,
modified datetime,
modifier_id int(10) unsigned,
primary key (id),
key type (layout_id,prototype(10),name(10))
primary key (id),
key type (layout_id, prototype, name(191))
);

create table tag (
id int(10) unsigned not null default '0',
name varchar(255) character set utf8 collate utf8_general_ci,
name varchar(500),
site_id int(10) unsigned,
type varchar(20),
primary key (id),
key tags (site_id,type,name)
type varchar(50),
primary key (id),
key tags (site_id, type, name(191))
);

create table tag_hub (
id int(10) unsigned not null default '0',
tag_id int(10) unsigned,
tagged_id int(10) unsigned,
tagged_type varchar(20),
primary key (id),
key tagged (tag_id,tagged_type,tagged_id)
tagged_type varchar(50),
primary key (id),
key tagged (tag_id, tagged_type, tagged_id)
);

create table vote (
id int(10) unsigned not null default '0',
poll_id int(10) unsigned,
choice_id int(10) unsigned,
creator_name varchar(255) character set utf8 collate utf8_general_ci,
creator_name varchar(500),
created datetime,
creator_id int(10) unsigned,
modified datetime,
primary key (id),
primary key (id),
key poll_id (poll_id),
key creator_id (creator_id),
key choice_id (choice_id),
key creator_name (creator_name(20))
key creator_name (creator_name(191))
);

set foreign_key_checks = 1;
Oops, something went wrong.

0 comments on commit 313833e

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.