Files
spring-rest-api/src/main/resources/db/migration/V1__init.sql
Catalin Patrut 4a3a9923ef working example
2021-08-08 12:36:07 +02:00

23 lines
645 B
SQL

create schema if not exists blog;
create table if not exists blog.posts
(
id uuid primary key,
title varchar(255) not null,
author varchar(255) not null,
content text not null,
creation_time timestamp not null,
update_time timestamp
);
create table if not exists blog.comments
(
id uuid primary key,
title varchar(255) not null,
content text not null,
approved boolean default false,
creation_time timestamp not null,
update_time timestamp,
post_id uuid not null references blog.posts
);