TT#139652 expand reg_id for kamailio.mobile_push_registrations

The format of Android push tokens is a free-form binary string of up to
4096 bytes. Currently the tokens are under 256 bytes long, but we expand
the DB field anyway to be future-proof. Unfortunately MySQL doesn't
allow keys that long, so we have to restrict the field to 3072 bytes.

Further add an auto-increment integer primary key to make InnoDB happy.

Change-Id: Ic664d47b80f751397ec51688d8f399da06eac176
mr10.1
Richard Fuchs 4 years ago
parent b8bac3a905
commit 31527c2281

@ -0,0 +1,4 @@
ALTER TABLE kamailio.mobile_push_registrations
DROP id,
DROP INDEX reg_token,
MODIFY reg_id VARBINARY(255) NOT NULL PRIMARY KEY;

@ -0,0 +1,5 @@
ALTER TABLE kamailio.mobile_push_registrations
DROP PRIMARY KEY,
ADD id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
MODIFY reg_id VARBINARY(3072) NOT NULL,
ADD UNIQUE INDEX reg_token (reg_id);
Loading…
Cancel
Save