-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove password field from users table (migration)
- Loading branch information
1 parent
b94e774
commit 149b89d
Showing
3 changed files
with
62 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- ## Migration to remove password field from public.users (replaced with OSM OAuth) | ||
|
||
|
||
-- ## Apply Migration | ||
-- Start a transaction | ||
BEGIN; | ||
-- Drop the 'password' column if it exists | ||
ALTER TABLE IF EXISTS public.users | ||
DROP COLUMN IF EXISTS password; | ||
-- Commit the transaction | ||
COMMIT; | ||
|
||
|
||
-- ## Revert Migration (comment above, uncomment below) | ||
-- -- Start a transaction | ||
-- BEGIN; | ||
-- -- Add the 'password' column back if it doesn't exist | ||
-- ALTER TABLE public.users | ||
-- ADD COLUMN IF NOT EXISTS password character varying; | ||
-- -- Commit the transaction | ||
-- COMMIT; | ||
|
||
|
||
-- ## Print a success message | ||
RAISE NOTICE 'Migration complete for public.users "password" field.'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters