Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Backfill token hashes

Neeraj Gupta1e36caad5346
diff --git a/server/migrations/135_backfill_token_hash.down.sql b/server/migrations/135_backfill_token_hash.down.sql
new file mode 100644
index 0000000000..9f7060a47f
--- /dev/null
+++ b/server/migrations/135_backfill_token_hash.down.sql
@@ -0,0 +1 @@
+-- no-op
diff --git a/server/migrations/135_backfill_token_hash.up.sql b/server/migrations/135_backfill_token_hash.up.sql
new file mode 100644
index 0000000000..8d8ea2d972
--- /dev/null
+++ b/server/migrations/135_backfill_token_hash.up.sql
@@ -0,0 +1,3 @@
+UPDATE tokens
+SET token_hash = sha256(convert_to(token, 'UTF8'))
+WHERE token_hash IS NULL;