Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cf-online-api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KS Pardubický kraj
cf-online-api
Commits
25ad8931
Verified
Commit
25ad8931
authored
4 years ago
by
Andrej Ramašeuski
Browse files
Options
Downloads
Patches
Plain Diff
Upravy schamatu
parent
cbedd946
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/CF/Schema/Result/Post.pm
+4
-1
4 additions, 1 deletion
lib/CF/Schema/Result/Post.pm
lib/CF/Schema/Result/Post_view.pm
+3
-1
3 additions, 1 deletion
lib/CF/Schema/Result/Post_view.pm
sql/2/up.sql
+16
-7
16 additions, 7 deletions
sql/2/up.sql
sql/3/up.sql
+7
-11
7 additions, 11 deletions
sql/3/up.sql
with
30 additions
and
20 deletions
lib/CF/Schema/Result/Post.pm
+
4
−
1
View file @
25ad8931
...
@@ -17,9 +17,12 @@ __PACKAGE__->add_columns(
...
@@ -17,9 +17,12 @@ __PACKAGE__->add_columns(
sequence
=>
'
uid_seq
'
sequence
=>
'
uid_seq
'
},
},
qw(
qw(
datetime
created
changed
deleted
is_archived
is_archived
user_id
user_id
program_entry_id
type
type
state
state
content
content
...
...
This diff is collapsed.
Click to expand it.
lib/CF/Schema/Result/Post_view.pm
+
3
−
1
View file @
25ad8931
...
@@ -24,12 +24,14 @@ sub format {
...
@@ -24,12 +24,14 @@ sub format {
my
$post
=
{
my
$post
=
{
id
=>
$self
->
id
,
id
=>
$self
->
id
,
datetime
=>
$self
->
datetime
,
datetime
=>
$self
->
created
,
type
=>
$self
->
type
,
type
=>
$self
->
type
,
state
=>
$self
->
state
,
state
=>
$self
->
state
,
content
=>
$self
->
content
,
content
=>
$self
->
content
,
is_archived
=>
$self
->
is_archived
,
is_archived
=>
$self
->
is_archived
,
is_changed
=>
$self
->
changed
?
1
:
0
,
author
=>
{
author
=>
{
id
=>
$self
->
user_id
,
name
=>
$self
->
user_name
,
name
=>
$self
->
user_name
,
group
=>
$self
->
group_name
,
group
=>
$self
->
group_name
,
},
},
...
...
This diff is collapsed.
Click to expand it.
sql/2/up.sql
+
16
−
7
View file @
25ad8931
create
table
"posts"
(
create
table
"posts"
(
"id"
integer
not
null
default
nextval
(
'uid_seq'
),
"id"
integer
not
null
default
nextval
(
'uid_seq'
),
"datetime"
timestamp
(
0
)
not
null
default
now
(),
"created"
timestamp
(
0
)
not
null
default
now
(),
"changed"
timestamp
(
0
),
"deleted"
timestamp
(
0
),
"is_archived"
bool
not
null
default
'false'
,
"is_archived"
bool
not
null
default
'false'
,
"user_id"
integer
not
null
,
"user_id"
integer
not
null
,
"program_entry_id"
integer
,
"type"
integer
not
null
,
-- 0 - "post" | "procedure-proposal"
"type"
integer
not
null
,
-- 0 - "post" | "procedure-proposal"
"state"
integer
not
null
default
0
,
"state"
integer
not
null
default
0
,
"content"
text
,
"content"
text
,
...
@@ -11,18 +14,24 @@ create table "posts" (
...
@@ -11,18 +14,24 @@ create table "posts" (
primary
key
(
"id"
)
primary
key
(
"id"
)
);
);
create
table
"
announcements
"
(
create
table
"
posts_history
"
(
"id"
integer
not
null
default
nextval
(
'uid_seq'
),
"id"
integer
not
null
default
nextval
(
'uid_seq'
),
"datetime"
timestamp
(
0
)
not
null
default
now
(),
"datetime"
timestamp
(
0
)
not
null
default
now
(),
"is_archived"
bool
not
null
default
'false'
,
"post_id"
integer
not
null
,
"user_id"
integer
,
"user_id"
integer
not
null
,
"type"
integer
not
null
,
"content"
text
,
"content"
text
,
"link"
text
,
"related_post_id"
integer
,
primary
key
(
"id"
)
primary
key
(
"id"
)
);
);
create
table
"posts_ranking"
(
"id"
integer
not
null
default
nextval
(
'uid_seq'
),
"post_id"
integer
not
null
,
"user_id"
integer
not
null
,
"ranking"
integer
,
primary
key
(
"id"
),
unique
(
"post_id"
,
"user_id"
)
);
create
view
"posts_view"
as
create
view
"posts_view"
as
select
select
"posts"
.
*
,
"posts"
.
*
,
...
...
This diff is collapsed.
Click to expand it.
sql/3/up.sql
+
7
−
11
View file @
25ad8931
create
table
"
posts_history
"
(
create
table
"
announcements
"
(
"id"
integer
not
null
default
nextval
(
'uid_seq'
),
"id"
integer
not
null
default
nextval
(
'uid_seq'
),
"datetime"
timestamp
(
0
)
not
null
default
now
(),
"datetime"
timestamp
(
0
)
not
null
default
now
(),
"post_id"
integer
not
null
,
"is_archived"
bool
not
null
default
'false'
,
"user_id"
integer
not
null
,
"user_id"
integer
,
"type"
integer
not
null
,
"content"
text
,
"content"
text
,
"link"
text
,
"related_post_id"
integer
,
primary
key
(
"id"
)
primary
key
(
"id"
)
);
);
create
table
"posts_ranking"
(
"id"
integer
not
null
default
nextval
(
'uid_seq'
),
"post_id"
integer
not
null
,
"user_id"
integer
not
null
,
"ranking"
integer
,
primary
key
(
"id"
),
unique
(
"post_id"
,
"user_id"
)
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment