mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(coderd/database): add value_key_id column to user_secrets for encryption (#23997)
Add a nullable `value_key_id` column to the `user_secrets` table with a foreign key to `dbcrypt_keys`. This is the column dbcrypt uses to track which encryption key encrypted a given secret's value. This is required for encryption of user secret values. The column was missing from the original migration (000357).
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE user_secrets
|
||||
DROP CONSTRAINT user_secrets_value_key_id_fkey,
|
||||
DROP COLUMN value_key_id;
|
||||
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE user_secrets
|
||||
ADD COLUMN value_key_id TEXT;
|
||||
|
||||
ALTER TABLE ONLY user_secrets
|
||||
ADD CONSTRAINT user_secrets_value_key_id_fkey FOREIGN KEY (value_key_id) REFERENCES dbcrypt_keys(active_key_digest);
|
||||
Reference in New Issue
Block a user