Merge branch 'main' of git.hackbever.be:rusty-bever/blog
This commit is contained in:
commit
5b465867e6
6 changed files with 22 additions and 5 deletions
|
|
@ -5,5 +5,6 @@ drop function enforce_version_titles;
|
|||
drop index sections_shortname_index;
|
||||
|
||||
drop table versions cascade;
|
||||
drop table tags cascade;
|
||||
drop table posts cascade;
|
||||
drop table sections cascade;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,14 @@ create table versions (
|
|||
|
||||
-- This check allows draft posts to be created without having to enter a
|
||||
-- publish date, but forces them to have one if they're not a draft.
|
||||
CHECK (is_draft OR publish_date IS NOT NULL)
|
||||
CONSTRAINT no_null_published_date CHECK (is_draft OR publish_date IS NOT NULL)
|
||||
);
|
||||
|
||||
create table tags (
|
||||
post_id uuid NOT NULL REFERENCES posts(id) ON DELETE CASCADE,
|
||||
value varchar(64) NOT NULL,
|
||||
|
||||
PRIMARY KEY (post_id, value)
|
||||
);
|
||||
|
||||
create function enforce_version_titles() returns trigger as $$
|
||||
|
|
|
|||
Reference in a new issue