summaryrefslogtreecommitdiffstats
path: root/lib/sql/migration/001-hex-hash-types.sql
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sql/migration/001-hex-hash-types.sql')
-rw-r--r--lib/sql/migration/001-hex-hash-types.sql8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sql/migration/001-hex-hash-types.sql b/lib/sql/migration/001-hex-hash-types.sql
new file mode 100644
index 0000000..cef6b0b
--- /dev/null
+++ b/lib/sql/migration/001-hex-hash-types.sql
@@ -0,0 +1,8 @@
+BEGIN;
+ALTER TABLE patchwork_patch ALTER COLUMN hash DROP NOT NULL;
+UPDATE patchwork_patch SET hash = NULL;
+COMMIT;
+BEGIN;
+ALTER TABLE patchwork_patch ALTER COLUMN hash TYPE CHAR(40);
+CREATE INDEX "patchwork_patch_hash" ON "patchwork_patch" ("hash");
+COMMIT;