server: enusre post.link is not null and not empty

This commit is contained in:
Bill Thiede 2024-12-25 10:12:33 -08:00
parent 4c6b9cde39
commit dad30357ac
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,7 @@
ALTER TABLE
post
ALTER COLUMN
link DROP NOT NULL;
ALTER TABLE
post DROP CONSTRAINT link;

View File

@ -0,0 +1,17 @@
DELETE FROM
post
WHERE
link IS NULL
OR link = '';
ALTER TABLE
post
ALTER COLUMN
link
SET
NOT NULL;
ALTER TABLE
post
ADD
CONSTRAINT link CHECK (link <> '');