Bug#1002652: bullseye-pu: package schleuder/3.6.0-3+deb11u1
Control: retitle -1 bullseye-pu: package schleuder/3.6.0-3+deb11u1
--
Hi,
The proposed package used an incorrect versioning scheme targeting
buster, not bullseye.
The attached debdiff is fixed in this regard.
Sorry for this noise.
Cheers,
Georg
diffstat for schleuder-3.6.0 schleuder-3.6.0
changelog | 12 ++
patches/0031-db-change-boolean-values-to-integers.patch | 77 ++++++++++++++++
patches/series | 1
3 files changed, 90 insertions(+)
diff -Nru schleuder-3.6.0/debian/changelog schleuder-3.6.0/debian/changelog
--- schleuder-3.6.0/debian/changelog 2021-07-29 20:36:52.000000000 +0000
+++ schleuder-3.6.0/debian/changelog 2021-12-26 16:28:29.000000000 +0000
@@ -1,3 +1,15 @@
+schleuder (3.6.0-3+deb11u1) bullseye; urgency=medium
+
+ * debian/patches:
+ - Pull in upstream patch to migrate boolean values to integers, if the
+ ActiveRecord SQLite3 connection adapter is in use. Since ActiveRecord >=
+ 6.0, the relevant code relies on boolean serialization to use 1 and 0,
+ but does not natively recognize 't' and 'f' as booleans were previously
+ serialized. This change made existing mailing lists fail, if people were
+ upgrading buster to bullseye. (Closes: #100262)
+
+ -- Georg Faerber <georg@debian.org> Sun, 26 Dec 2021 16:28:29 +0000
+
schleuder (3.6.0-3) unstable; urgency=medium
* debian/patches:
diff -Nru schleuder-3.6.0/debian/patches/0031-db-change-boolean-values-to-integers.patch schleuder-3.6.0/debian/patches/0031-db-change-boolean-values-to-integers.patch
--- schleuder-3.6.0/debian/patches/0031-db-change-boolean-values-to-integers.patch 1970-01-01 00:00:00.000000000 +0000
+++ schleuder-3.6.0/debian/patches/0031-db-change-boolean-values-to-integers.patch 2021-12-26 16:28:29.000000000 +0000
@@ -0,0 +1,77 @@
+Description: DB: change boolean values to integers
+ Since ActiveRecord >= 6.0, the SQLite3 connection adapter relies on boolean
+ serialization to use 1 and 0, but does not natively recognize 't' and 'f' as
+ booleans were previously serialized. Accordingly, this patch handles
+ conversion via a database migration of both column defaults and stored data
+ provided by a user.
+Author: Georg Faerber <georg@riseup.net>
+Origin: upstream
+Bug: https://0xacab.org/schleuder/schleuder/-/issues/505
+Applied-Upstream: 9ee12c4a1d6604c860c44073b99d8258bb4bc0ae
+Last-Update: 2021-12-25
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: schleuder/db/migrate/20211106112020_change_boolean_values_to_integers.rb
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ schleuder/db/migrate/20211106112020_change_boolean_values_to_integers.rb 2021-12-26 17:28:42.468530957 +0000
+@@ -0,0 +1,46 @@
++# Since ActiveRecord >= 6.0, the SQLite3 connection adapter relies on boolean
++# serialization to use 1 and 0, but does not natively recognize 't' and 'f' as
++# booleans were previously serialized.
++#
++# Accordingly, this migration handles conversion of both column defaults and
++# stored data provided by a user.
++#
++# In contrast to other migrations, only a 'forward' method is provided, a
++# mechanism to 'reverse' is not. Given the nature of this migration, the later
++# is not really required.
++#
++# Unfortunately, we missed this breaking change when bumping ActiveRecord to >=
++# 6.0 in Schleuder version 4.0. This caused quite some work upstream, but also
++# in downstream environments and, last but not least, at the side of users.
++#
++# We should extend our CI to explicitly test, and ensure things work as
++# expected, if running a Schleuder setup in real world. As of now, we don't
++# ensure data provided by a user in Schleuder version x still works after
++# upgrading to version y.
++
++class ChangeBooleanValuesToIntegers < ActiveRecord::Migration[6.0]
++ class Lists < ActiveRecord::Base
++ end
++
++ class Subscriptions < ActiveRecord::Base
++ end
++
++ def up
++ [Lists, Subscriptions].each do |table|
++ unless table.connection.is_a?(ActiveRecord::ConnectionAdapters::SQLite3Adapter)
++ return
++ end
++
++ bool_columns_defaults = table.columns.select { |column| column.type == :boolean }.map{ |column| [column.name, column.default] }
++
++ bool_columns_defaults.each do |column_name, column_default|
++ column_bool = ActiveRecord::Type::Boolean.new.deserialize(column_default)
++
++ change_column_default :"#{table.table_name}", :"#{column_name}", column_bool
++
++ table.where("#{column_name} = 'f'").update_all("#{column_name}": 0)
++ table.where("#{column_name} = 't'").update_all("#{column_name}": 1)
++ end
++ end
++ end
++end
+Index: schleuder/db/schema.rb
+===================================================================
+--- schleuder.orig/db/schema.rb 2021-12-26 17:28:42.472530996 +0000
++++ schleuder/db/schema.rb 2021-12-26 17:29:04.460747148 +0000
+@@ -10,7 +10,7 @@
+ #
+ # It's strongly recommended that you check this file into your version control system.
+
+-ActiveRecord::Schema.define(version: 2020_01_18_170110) do
++ActiveRecord::Schema.define(version: 2021_11_06_112020) do
+
+ create_table "lists", force: :cascade do |t|
+ t.datetime "created_at"
diff -Nru schleuder-3.6.0/debian/patches/series schleuder-3.6.0/debian/patches/series
--- schleuder-3.6.0/debian/patches/series 2021-07-29 20:36:52.000000000 +0000
+++ schleuder-3.6.0/debian/patches/series 2021-12-26 16:28:29.000000000 +0000
@@ -14,3 +14,4 @@
0001-lib-fix-paths.patch
0002-etc-fix-paths.patch
0026-Change-way-to-block-passphrase-interaction.patch
+0031-db-change-boolean-values-to-integers.patch
Reply to: