server: enusre post.link is not null and not empty
This commit is contained in:
parent
4c6b9cde39
commit
dad30357ac
@ -0,0 +1,7 @@
|
|||||||
|
ALTER TABLE
|
||||||
|
post
|
||||||
|
ALTER COLUMN
|
||||||
|
link DROP NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE
|
||||||
|
post DROP CONSTRAINT link;
|
||||||
17
server/migrations/20241225180250_post-link-non-empty.up.sql
Normal file
17
server/migrations/20241225180250_post-link-non-empty.up.sql
Normal 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 <> '');
|
||||||
Loading…
x
Reference in New Issue
Block a user