v/pol
1
0
mirror of https://github.com/taroved/pol synced 2025-05-16 06:10:09 -07:00

reduse db size (1)

This commit is contained in:
Alexandr Nesterenko 2018-02-16 11:40:04 +03:00
parent 2abe04457c
commit bc0545a3c8

View File

@ -12,10 +12,10 @@ class Migration(migrations.Migration):
]
operations = [
migrations.RunSQL("ALTER TABLE `frontend_post` ADD COLUMN `md5sum2` BINARY(16) DEFAULT 0 NOT NULL;"
migrations.RunSQL("ALTER TABLE `frontend_post` ADD COLUMN `md5sum2` BINARY(128) DEFAULT 0 NOT NULL;"
"UPDATE `frontend_post` set `md5sum2` = unhex(`md5sum`);"
"ALTER TABLE frontend_post DROP COLUMN md5sum;"
"ALTER TABLE frontend_post CHANGE COLUMN md5sum2 md5sum BINARY(16) NOT NULL;"
"ALTER TABLE frontend_post CHANGE COLUMN md5sum2 md5sum BINARY(128) NOT NULL;"
"CREATE INDEX md5sum_index USING HASH ON frontend_post (feed_id, md5sum);",
state_operations=[
migrations.AlterField(