add deleted_at on article and constitution
This commit is contained in:
@@ -15,4 +15,5 @@ class Article(
|
|||||||
UuidEntity(id),
|
UuidEntity(id),
|
||||||
EntityVersioning<UUID, Int> by UuidEntityVersioning(),
|
EntityVersioning<UUID, Int> by UuidEntityVersioning(),
|
||||||
EntityCreatedAt by EntityCreatedAtImp(),
|
EntityCreatedAt by EntityCreatedAtImp(),
|
||||||
EntityCreatedBy<Citizen> by EntityCreatedByImp(createdBy)
|
EntityCreatedBy<Citizen> by EntityCreatedByImp(createdBy),
|
||||||
|
EntityDeletedAt by EntityDeletedAtImp()
|
||||||
@@ -12,7 +12,8 @@ class Constitution(
|
|||||||
): UuidEntity(id),
|
): UuidEntity(id),
|
||||||
EntityVersioning<UUID, Int> by UuidEntityVersioning(),
|
EntityVersioning<UUID, Int> by UuidEntityVersioning(),
|
||||||
EntityCreatedAt by EntityCreatedAtImp(),
|
EntityCreatedAt by EntityCreatedAtImp(),
|
||||||
EntityCreatedBy<Citizen> by EntityCreatedByImp(createdBy) {
|
EntityCreatedBy<Citizen> by EntityCreatedByImp(createdBy),
|
||||||
|
EntityDeletedAt by EntityDeletedAtImp() {
|
||||||
|
|
||||||
init{
|
init{
|
||||||
titles.forEachIndexed { index, title ->
|
titles.forEachIndexed { index, title ->
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ create table article
|
|||||||
content text not null check ( content != '' ),
|
content text not null check ( content != '' ),
|
||||||
description text null check ( description != '' ),
|
description text null check ( description != '' ),
|
||||||
tags varchar(32)[] default '{}' not null,
|
tags varchar(32)[] default '{}' not null,
|
||||||
|
deleted_at timestamptz default null null,
|
||||||
unique (version_id, version_number)
|
unique (version_id, version_number)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -121,7 +122,9 @@ create table constitution
|
|||||||
version_id uuid default uuid_generate_v4() not null,
|
version_id uuid default uuid_generate_v4() not null,
|
||||||
version_number int not null,
|
version_number int not null,
|
||||||
title text not null check ( length(title) < 128 ),
|
title text not null check ( length(title) < 128 ),
|
||||||
anonymous boolean default false not null
|
anonymous boolean default false not null,
|
||||||
|
deleted_at timestamptz default null null,
|
||||||
|
unique (version_id, version_number)
|
||||||
);
|
);
|
||||||
|
|
||||||
create trigger generate_version_number_trigger
|
create trigger generate_version_number_trigger
|
||||||
|
|||||||
Reference in New Issue
Block a user