Compare commits
3 Commits
experiment
...
5a8c0028d7
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a8c0028d7 | |||
| f7e6e56aca | |||
| a0043fd475 |
1
.go-version
Normal file
1
.go-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
1.23.6
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
-- 0003_user_credentials.sql
|
||||||
|
-- Create user_credentials table for password storage (extensible for other auth methods)
|
||||||
|
|
||||||
|
CREATE TABLE user_credentials (
|
||||||
|
id UUID PRIMARY KEY,
|
||||||
|
user_id UUID NOT NULL REFERENCES users(id),
|
||||||
|
credential_type TEXT NOT NULL DEFAULT 'password',
|
||||||
|
password_hash TEXT,
|
||||||
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Each user can have at most one credential per type
|
||||||
|
CREATE UNIQUE INDEX user_credentials_user_type_idx ON user_credentials (user_id, credential_type);
|
||||||
|
|
||||||
|
-- Index for user lookups
|
||||||
|
CREATE INDEX user_credentials_user_id_idx ON user_credentials (user_id);
|
||||||
Reference in New Issue
Block a user