-- KimsQ PHP 8 / MySQL 8+ migration
-- Take a verified database backup before running this file.
--
-- Set this to the value that precedes "_s_mbrid" in your database.
-- The legacy default is rb (which produces rb_s_mbrid).
SET @kimsq_table_prefix = 'rb';

SET @sql = CONCAT(
  'ALTER TABLE ',
  @kimsq_table_prefix,
  '_s_mbrid MODIFY COLUMN pw VARCHAR(255) NOT NULL DEFAULT '''''
);
PREPARE kimsq_password_column FROM @sql;
EXECUTE kimsq_password_column;
DEALLOCATE PREPARE kimsq_password_column;

-- Existing MD5 values remain usable temporarily. The first successful login
-- replaces each one with PHP's current password_hash() value automatically.
