Skip to content

Commit

Permalink
remove unneeded constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Aug 11, 2024
1 parent 93fb77e commit 8edfd8a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions conf/evolutions/default/95.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ ALTER TABLE IF EXISTS users
ALTER COLUMN avatar_url SET DEFAULT '/assets/images/user_no_image.png',
ALTER COLUMN avatar_url SET NOT NULL;

-- Add a CHECK constraint to ensure avatar_url is a string (TEXT type)
ALTER TABLE IF EXISTS users
ADD CONSTRAINT check_avatar_url_is_string CHECK (pg_typeof(avatar_url) = 'text');

-- --- !Downs
-- Remove the CHECK constraint
ALTER TABLE IF EXISTS users
DROP CONSTRAINT IF EXISTS check_avatar_url_is_string;

-- Revert the avatar_url column to allow null values and remove the default value
ALTER TABLE IF EXISTS users
ALTER COLUMN avatar_url DROP NOT NULL,
Expand Down

0 comments on commit 8edfd8a

Please sign in to comment.