Add some sql check
This commit is contained in:
1
.idea/runConfigurations/All_Tests.xml
generated
1
.idea/runConfigurations/All_Tests.xml
generated
@@ -1,7 +1,6 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="All Tests" type="JUnit" factoryName="JUnit" show_console_on_std_err="true">
|
<configuration default="false" name="All Tests" type="JUnit" factoryName="JUnit" show_console_on_std_err="true">
|
||||||
<output_file path="$PROJECT_DIR$/var/log/test/out.log" is_save="true" />
|
<output_file path="$PROJECT_DIR$/var/log/test/out.log" is_save="true" />
|
||||||
<log_file alias="test.log" path="$PROJECT_DIR$/var/log/test" />
|
|
||||||
<module name="dcproject.test" />
|
<module name="dcproject.test" />
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
||||||
<option name="ALTERNATIVE_JRE_PATH" value="11" />
|
<option name="ALTERNATIVE_JRE_PATH" value="11" />
|
||||||
|
|||||||
1
.idea/runConfigurations/RunCucumberTest.xml
generated
1
.idea/runConfigurations/RunCucumberTest.xml
generated
@@ -1,7 +1,6 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="RunCucumberTest" type="JUnit" factoryName="JUnit" nameIsGenerated="true">
|
<configuration default="false" name="RunCucumberTest" type="JUnit" factoryName="JUnit" nameIsGenerated="true">
|
||||||
<output_file path="$PROJECT_DIR$/var/log/test/cucumber.out.log" is_save="true" />
|
<output_file path="$PROJECT_DIR$/var/log/test/cucumber.out.log" is_save="true" />
|
||||||
<log_file alias="cucumber.log" path="$PROJECT_DIR$/var/log/test" />
|
|
||||||
<module name="dcproject.test" />
|
<module name="dcproject.test" />
|
||||||
<option name="PACKAGE_NAME" value="" />
|
<option name="PACKAGE_NAME" value="" />
|
||||||
<option name="MAIN_CLASS_NAME" value="RunCucumberTest" />
|
<option name="MAIN_CLASS_NAME" value="RunCucumberTest" />
|
||||||
|
|||||||
@@ -99,10 +99,10 @@ create table article
|
|||||||
created_by_id uuid not null references citizen (id),
|
created_by_id uuid not null references citizen (id),
|
||||||
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,
|
title text not null check ( length(title) < 128 ),
|
||||||
annonymous boolean default false not null,
|
annonymous boolean default false not null,
|
||||||
content text not null check ( content != '' ),
|
content text not null check ( content != '' ),
|
||||||
description text,
|
description text null check ( description != '' ),
|
||||||
tags varchar(32)[] default '{}' not null,
|
tags varchar(32)[] default '{}' not null,
|
||||||
unique (version_id, version_number)
|
unique (version_id, version_number)
|
||||||
);
|
);
|
||||||
@@ -120,7 +120,7 @@ create table constitution
|
|||||||
created_by_id uuid not null references citizen (id),
|
created_by_id uuid not null references citizen (id),
|
||||||
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,
|
title text not null check ( length(title) < 128 ),
|
||||||
annonymous boolean default false not null
|
annonymous boolean default false not null
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ create table title
|
|||||||
created_at timestamptz default now() not null,
|
created_at timestamptz default now() not null,
|
||||||
created_by_id uuid not null references citizen (id),
|
created_by_id uuid not null references citizen (id),
|
||||||
name text not null check ( name != '' ),
|
name text not null check ( name != '' ),
|
||||||
rank int not null,
|
rank int not null check ( rank >= 0 ),
|
||||||
constitution_id uuid not null references constitution (id)
|
constitution_id uuid not null references constitution (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ create table article_in_title
|
|||||||
id uuid default uuid_generate_v4() not null primary key,
|
id uuid default uuid_generate_v4() not null primary key,
|
||||||
created_at timestamptz default now() not null,
|
created_at timestamptz default now() not null,
|
||||||
created_by_id uuid not null references citizen (id),
|
created_by_id uuid not null references citizen (id),
|
||||||
rank int not null,
|
rank int not null check ( rank >= 0 ),
|
||||||
title_id uuid not null references title (id),
|
title_id uuid not null references title (id),
|
||||||
article_id uuid not null references article (id),
|
article_id uuid not null references article (id),
|
||||||
constitution_id uuid not null references constitution (id)
|
constitution_id uuid not null references constitution (id)
|
||||||
@@ -175,7 +175,7 @@ create table article_relations
|
|||||||
target_id uuid references article check ( source_id != target_id ),
|
target_id uuid references article check ( source_id != target_id ),
|
||||||
created_at timestamptz default now(),
|
created_at timestamptz default now(),
|
||||||
created_by_id uuid not null references citizen (id),
|
created_by_id uuid not null references citizen (id),
|
||||||
comment text null,
|
comment text null check ( comment != '' ),
|
||||||
primary key (source_id, target_id)
|
primary key (source_id, target_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ create table follow_citizen
|
|||||||
create table comment
|
create table comment
|
||||||
(
|
(
|
||||||
updated_at timestamptz default now() not null check ( updated_at >= created_at ),
|
updated_at timestamptz default now() not null check ( updated_at >= created_at ),
|
||||||
"content" text not null check ( content != '' ),
|
"content" text not null check ( content != '' and length(content) < 4096),
|
||||||
parent_id uuid null references comment (id),
|
parent_id uuid null references comment (id),
|
||||||
foreign key (citizen_id) references citizen (id),
|
foreign key (citizen_id) references citizen (id),
|
||||||
primary key (id)
|
primary key (id)
|
||||||
|
|||||||
Reference in New Issue
Block a user