aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/database/migrations/0002_nullable_passwords.sql
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2025-08-15 19:20:48 +0100
committerLeonardo Bishop <me@leonardobishop.com>2025-08-15 19:20:48 +0100
commit8f7dec8ba6b2f9bde01afd0a110596ebbd43e0ed (patch)
tree7b4f203d92f4b99b1e98fac314415e293984196b /pkg/database/migrations/0002_nullable_passwords.sql
parent4697556cac819c47d068819b9fc9c3b4ea84e279 (diff)
Implement OIDC
Diffstat (limited to 'pkg/database/migrations/0002_nullable_passwords.sql')
-rw-r--r--pkg/database/migrations/0002_nullable_passwords.sql4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/database/migrations/0002_nullable_passwords.sql b/pkg/database/migrations/0002_nullable_passwords.sql
new file mode 100644
index 0000000..2f31366
--- /dev/null
+++ b/pkg/database/migrations/0002_nullable_passwords.sql
@@ -0,0 +1,4 @@
+-- +goose Up
+ALTER TABLE users DROP CONSTRAINT valid_hash;
+ALTER TABLE users ALTER COLUMN password DROP NOT NULL;
+ALTER TABLE users ADD CONSTRAINT valid_hash CHECK (length(password) = 60 OR password IS NULL);