“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust. I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it Currently working for GenieBelt who are based in Copenhagen, Denmark ...”

Rob Lacey
Senior Software Engineer, Copenhagen, Denmark

MySQL encoding

Needed to fix the collation on MySQL.

mysql> DESC videos;
+--------------+--------------+------+-----+---------+----------------+
| Field        | Type         | Null | Key | Default | Extra          |
+--------------+--------------+------+-----+---------+----------------+
| id           | int(11)      | NO   | PRI | NULL    | auto_increment |
| identifier   | varchar(255) | YES  |     | NULL    |                |
| full_name    | varchar(255) | YES  |     | NULL    |                |
| description  | text         | YES  |     | NULL    |                |
| published_at | datetime     | YES  |     | NULL    |                |
| created_at   | datetime     | NO   |     | NULL    |                |
| updated_at   | datetime     | NO   |     | NULL    |                |
| publish      | tinyint(1)   | YES  |     | 0       |                |
+--------------+--------------+------+-----+---------+----------------+
8 rows in set (0.00 sec)

mysql> SHOW FULL COLUMNS FROM videos;
+--------------+--------------+-------------------+------+-----+---------+----------------+---------------------------------+---------+
| Field        | Type         | Collation         | Null | Key | Default | Extra          | Privileges                      | Comment |
+--------------+--------------+-------------------+------+-----+---------+----------------+---------------------------------+---------+
| id           | int(11)      | NULL              | NO   | PRI | NULL    | auto_increment | select,insert,update,references |         |
| identifier   | varchar(255) | latin1_swedish_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| full_name    | varchar(255) | latin1_swedish_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| description  | text         | latin1_swedish_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| published_at | datetime     | NULL              | YES  |     | NULL    |                | select,insert,update,references |         |
| created_at   | datetime     | NULL              | NO   |     | NULL    |                | select,insert,update,references |         |
| updated_at   | datetime     | NULL              | NO   |     | NULL    |                | select,insert,update,references |         |
| publish      | tinyint(1)   | NULL              | YES  |     | 0       |                | select,insert,update,references |         |
+--------------+--------------+-------------------+------+-----+---------+----------------+---------------------------------+---------+
8 rows in set (0.00 sec)

mysql> ALTER TABLE iplayred.videos CONVERT TO CHARACTER SET utf8;
Query OK, 105 rows affected (0.01 sec)
Records: 105  Duplicates: 0  Warnings: 0

mysql> SHOW FULL COLUMNS FROM videos;
+--------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| Field        | Type         | Collation       | Null | Key | Default | Extra          | Privileges                      | Comment |
+--------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| id           | int(11)      | NULL            | NO   | PRI | NULL    | auto_increment | select,insert,update,references |         |
| identifier   | varchar(255) | utf8_general_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| full_name    | varchar(255) | utf8_general_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| description  | mediumtext   | utf8_general_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| published_at | datetime     | NULL            | YES  |     | NULL    |                | select,insert,update,references |         |
| created_at   | datetime     | NULL            | NO   |     | NULL    |                | select,insert,update,references |         |
| updated_at   | datetime     | NULL            | NO   |     | NULL    |                | select,insert,update,references |         |
| publish      | tinyint(1)   | NULL            | YES  |     | 0       |                | select,insert,update,references |         |
+--------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
8 rows in set (0.00 sec)