Commit 2ce6c055 authored by Héctor Orón Martínez's avatar Héctor Orón Martínez

Merge branch 'migration-patch' into 'debian/master'

Add patch to fix the database migration

See merge request !21
parents 3e94d52f 8fac779a
......@@ -7,8 +7,10 @@ open-build-service (2.9.4-3) UNRELEASED; urgency=medium
* Add some autopkgtests test cases
* Fix obsapidelayed.service.
Split the obsapidelayed systemd unit file into others unit files
* Add patch to fix the database migration.
Limit the size of a VARCHAR to not extrapolate the number of bytes allocated.
-- Lucas Kanashiro <kanashiro@debian.org> Tue, 02 Apr 2019 20:16:43 -0300
-- Lucas Kanashiro <kanashiro@debian.org> Mon, 08 Apr 2019 09:33:51 -0300
open-build-service (2.9.4-2) unstable; urgency=medium
......
From: Lucas Kanashiro <lucas.kanashiro@collabora.com>
Date: Mon, 8 Apr 2019 09:17:00 -0300
Subject: Limit the VARCHAR max size in the mysql database
As described in this issue (https://github.com/rails/rails/issues/9855)
due to some encoding changes on latest versions of mysql the max size
of a string can extrapolate the number of bytes allocated by the
database. To avoid that, the VARCHAR max size is limited to 191.
---
src/api/config/initializers/mysqlpls.rb | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 src/api/config/initializers/mysqlpls.rb
diff --git a/src/api/config/initializers/mysqlpls.rb b/src/api/config/initializers/mysqlpls.rb
new file mode 100644
index 0000000..8388027
--- /dev/null
+++ b/src/api/config/initializers/mysqlpls.rb
@@ -0,0 +1,9 @@
+require 'active_record/connection_adapters/abstract_mysql_adapter'
+
+module ActiveRecord
+ module ConnectionAdapters
+ class AbstractMysqlAdapter
+ NATIVE_DATABASE_TYPES[:string] = { :name => "varchar", :limit => 191 }
+ end
+ end
+end
......@@ -20,3 +20,4 @@ rails5.2-fix-for-data-migrate.patch
rails-5.2-add-prefix-to-kiwi.patch
no-signing-server-config.patch
publish-ddeb-files.patch
Limit-the-VARCHAR-max-size-in-the-mysql-database.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment