Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
templateService
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bazarbay Tulenov
templateService
Commits
f85e2dfb
Commit
f85e2dfb
authored
Jun 13, 2024
by
bazarbay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first commit
parent
2c8d8510
Pipeline
#387
failed with stage
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
167 additions
and
8 deletions
+167
-8
build.gradle
build.gradle
+1
-1
src/main/java/kz/project/printedFormsService/data/entity/DocumentEntity.java
...oject/printedFormsService/data/entity/DocumentEntity.java
+1
-0
src/main/java/kz/project/printedFormsService/data/entity/TemplateFileInfoEntity.java
...intedFormsService/data/entity/TemplateFileInfoEntity.java
+1
-0
src/main/resources/application.yml
src/main/resources/application.yml
+8
-5
src/main/resources/db/changelog/db.changelog-master.xml
src/main/resources/db/changelog/db.changelog-master.xml
+156
-0
src/main/resources/db/migration/V1__create_db_and_schema.sql
src/main/resources/db/migration/V1__create_db_and_schema.sql
+0
-2
No files found.
build.gradle
View file @
f85e2dfb
...
@@ -53,7 +53,7 @@ dependencies {
...
@@ -53,7 +53,7 @@ dependencies {
implementation
'commons-codec:commons-codec:1.16.0'
implementation
'commons-codec:commons-codec:1.16.0'
implementation
group:
'javax.validation'
,
name:
'validation-api'
,
version:
'2.0.1.Final'
implementation
group:
'javax.validation'
,
name:
'validation-api'
,
version:
'2.0.1.Final'
implementation
'org.jetbrains:annotations:24.0.1'
implementation
'org.jetbrains:annotations:24.0.1'
// implementation "org.flywaydb:flyway-core"
implementation
'org.liquibase:liquibase-core'
}
}
dependencyManagement
{
dependencyManagement
{
...
...
src/main/java/kz/project/printedFormsService/data/entity/DocumentEntity.java
View file @
f85e2dfb
...
@@ -25,6 +25,7 @@ public class DocumentEntity {
...
@@ -25,6 +25,7 @@ public class DocumentEntity {
private
TemplateEntity
template
;
private
TemplateEntity
template
;
@CreationTimestamp
@CreationTimestamp
@Column
(
name
=
"created_at"
)
private
LocalDateTime
createdAt
;
private
LocalDateTime
createdAt
;
private
String
project
;
private
String
project
;
...
...
src/main/java/kz/project/printedFormsService/data/entity/TemplateFileInfoEntity.java
View file @
f85e2dfb
...
@@ -17,6 +17,7 @@ public class TemplateFileInfoEntity {
...
@@ -17,6 +17,7 @@ public class TemplateFileInfoEntity {
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
private
Long
id
;
private
String
name
;
private
String
name
;
@Column
(
name
=
"is_header"
)
private
Boolean
isHeader
;
private
Boolean
isHeader
;
private
String
path
;
private
String
path
;
private
Integer
hash
;
private
Integer
hash
;
...
...
src/main/resources/application.yml
View file @
f85e2dfb
...
@@ -24,7 +24,7 @@ spring:
...
@@ -24,7 +24,7 @@ spring:
jpa
:
jpa
:
hibernate
:
hibernate
:
jdbc.time_zone
:
Asia/Almaty
jdbc.time_zone
:
Asia/Almaty
ddl-auto
:
up
date
ddl-auto
:
vali
date
database-platform
:
org.hibernate.dialect.PostgreSQLDialect
database-platform
:
org.hibernate.dialect.PostgreSQLDialect
datasource
:
datasource
:
url
:
jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:template_db}?currentSchema=template_schema
url
:
jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:template_db}?currentSchema=template_schema
...
@@ -35,15 +35,18 @@ spring:
...
@@ -35,15 +35,18 @@ spring:
minimum-idle
:
2
minimum-idle
:
2
leak-detection-threshold
:
30000
# 30000 - 30 seconds
leak-detection-threshold
:
30000
# 30000 - 30 seconds
auto-commit
:
false
auto-commit
:
false
# flyway:
liquibase
:
# enabled: ${FLYWAY_ENABLED:true}
change-log
:
classpath:db/changelog/db.changelog-master.xml
# baseline-on-migrate: ${FLYWAY_BASELINE:true}
default-schema
:
template_schema
# out-of-order: ${FLYWAY_OUT_OF_ORDER:true}
rabbitmq
:
rabbitmq
:
host
:
${RABBITMQ_HOST:localhost}
host
:
${RABBITMQ_HOST:localhost}
port
:
${RABBITMQ_PORT:5672}
port
:
${RABBITMQ_PORT:5672}
username
:
${RABBITMQ_USERNAME:guest}
username
:
${RABBITMQ_USERNAME:guest}
password
:
${RABBITMQ_PASSWORD:guest}
password
:
${RABBITMQ_PASSWORD:guest}
listener
:
simple
:
auto-startup
:
false
missing-queues-fatal
:
false
logging
:
logging
:
file
:
file
:
...
...
src/main/resources/db/changelog/db.changelog-master.xml
0 → 100644
View file @
f85e2dfb
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.0.xsd"
>
<!-- ChangeSet для создания таблицы template_schema.file_info -->
<changeSet
id=
"1"
author=
"yourname"
>
<createTable
tableName=
"file_info"
schemaName=
"template_schema"
>
<column
name=
"id"
type=
"BIGSERIAL"
>
<constraints
primaryKey=
"true"
nullable=
"false"
/>
</column>
<column
name=
"name"
type=
"VARCHAR(255)"
/>
<column
name=
"is_header"
type=
"BOOLEAN"
/>
<column
name=
"path"
type=
"VARCHAR(255)"
/>
<column
name=
"hash"
type=
"INTEGER"
/>
<column
name=
"data"
type=
"BYTEA"
/>
</createTable>
</changeSet>
<!-- ChangeSet для создания таблицы template_schema.d_template_type -->
<changeSet
id=
"2"
author=
"yourname"
>
<createTable
tableName=
"d_template_type"
schemaName=
"template_schema"
>
<column
name=
"id"
type=
"BIGSERIAL"
>
<constraints
primaryKey=
"true"
nullable=
"false"
/>
</column>
<column
name=
"code"
type=
"VARCHAR(255)"
/>
<column
name=
"name"
type=
"VARCHAR(255)"
/>
</createTable>
</changeSet>
<!-- ChangeSet для создания таблицы template_schema.template -->
<changeSet
id=
"3"
author=
"yourname"
>
<createTable
tableName=
"template"
schemaName=
"template_schema"
>
<column
name=
"id"
type=
"BIGSERIAL"
>
<constraints
primaryKey=
"true"
nullable=
"false"
/>
</column>
<column
name=
"code"
type=
"VARCHAR(255)"
/>
<column
name=
"name"
type=
"VARCHAR(255)"
/>
<column
name=
"status"
type=
"BOOLEAN"
/>
<column
name=
"project"
type=
"VARCHAR(255)"
/>
<column
name=
"version"
type=
"INTEGER"
/>
<column
name=
"type_id"
type=
"BIGINT"
/>
<column
name=
"template_id"
type=
"BIGINT"
/>
<column
name=
"template_header_id"
type=
"BIGINT"
/>
</createTable>
</changeSet>
<!-- ChangeSet для добавления внешнего ключа FK_TEMPLATE_ON_TEMPLATE -->
<changeSet
id=
"4"
author=
"yourname"
>
<addForeignKeyConstraint
baseTableName=
"template"
baseColumnNames=
"template_id"
constraintName=
"FK_TEMPLATE_ON_TEMPLATE"
referencedTableName=
"file_info"
referencedColumnNames=
"id"
baseTableSchemaName=
"template_schema"
referencedTableSchemaName=
"template_schema"
/>
</changeSet>
<!-- ChangeSet для добавления внешнего ключа FK_TEMPLATE_ON_TEMPLATEHEADER -->
<changeSet
id=
"5"
author=
"yourname"
>
<addForeignKeyConstraint
baseTableName=
"template"
baseColumnNames=
"template_header_id"
constraintName=
"FK_TEMPLATE_ON_TEMPLATEHEADER"
referencedTableName=
"file_info"
referencedColumnNames=
"id"
baseTableSchemaName=
"template_schema"
referencedTableSchemaName=
"template_schema"
/>
</changeSet>
<!-- ChangeSet для добавления внешнего ключа FK_TEMPLATE_ON_TYPE -->
<changeSet
id=
"6"
author=
"yourname"
>
<addForeignKeyConstraint
baseTableName=
"template"
baseColumnNames=
"type_id"
constraintName=
"FK_TEMPLATE_ON_TYPE"
referencedTableName=
"d_template_type"
referencedColumnNames=
"id"
baseTableSchemaName=
"template_schema"
referencedTableSchemaName=
"template_schema"
/>
</changeSet>
<!-- ChangeSet для создания таблицы template_schema.template_version -->
<changeSet
id=
"7"
author=
"yourname"
>
<createTable
tableName=
"template_version"
schemaName=
"template_schema"
>
<column
name=
"id"
type=
"BIGSERIAL"
>
<constraints
primaryKey=
"true"
nullable=
"false"
/>
</column>
<column
name=
"code"
type=
"VARCHAR(255)"
/>
<column
name=
"name"
type=
"VARCHAR(255)"
/>
<column
name=
"status"
type=
"BOOLEAN"
/>
<column
name=
"project"
type=
"VARCHAR(255)"
/>
<column
name=
"version"
type=
"INTEGER"
/>
<column
name=
"type_id"
type=
"BIGINT"
/>
<column
name=
"template_id"
type=
"BIGINT"
/>
<column
name=
"template_header_id"
type=
"BIGINT"
/>
</createTable>
</changeSet>
<!-- ChangeSet для добавления внешнего ключа FK_TEMPLATE_VERSION_ON_TEMPLATE -->
<changeSet
id=
"8"
author=
"yourname"
>
<addForeignKeyConstraint
baseTableName=
"template_version"
baseColumnNames=
"template_id"
constraintName=
"FK_TEMPLATE_VERSION_ON_TEMPLATE"
referencedTableName=
"file_info"
referencedColumnNames=
"id"
baseTableSchemaName=
"template_schema"
referencedTableSchemaName=
"template_schema"
/>
</changeSet>
<!-- ChangeSet для добавления внешнего ключа FK_TEMPLATE_VERSION_ON_TEMPLATEHEADER -->
<changeSet
id=
"9"
author=
"yourname"
>
<addForeignKeyConstraint
baseTableName=
"template_version"
baseColumnNames=
"template_header_id"
constraintName=
"FK_TEMPLATE_VERSION_ON_TEMPLATEHEADER"
referencedTableName=
"file_info"
referencedColumnNames=
"id"
baseTableSchemaName=
"template_schema"
referencedTableSchemaName=
"template_schema"
/>
</changeSet>
<!-- ChangeSet для добавления внешнего ключа FK_TEMPLATE_VERSION_ON_TYPE -->
<changeSet
id=
"10"
author=
"yourname"
>
<addForeignKeyConstraint
baseTableName=
"template_version"
baseColumnNames=
"type_id"
constraintName=
"FK_TEMPLATE_VERSION_ON_TYPE"
referencedTableName=
"d_template_type"
referencedColumnNames=
"id"
baseTableSchemaName=
"template_schema"
referencedTableSchemaName=
"template_schema"
/>
</changeSet>
<!-- ChangeSet для создания таблицы template_schema.document -->
<changeSet
id=
"11"
author=
"yourname"
>
<createTable
tableName=
"document"
schemaName=
"template_schema"
>
<column
name=
"id"
type=
"BIGSERIAL"
>
<constraints
primaryKey=
"true"
nullable=
"false"
/>
</column>
<column
name=
"template_id"
type=
"BIGINT"
/>
<column
name=
"created_at"
type=
"TIMESTAMP WITHOUT TIME ZONE"
/>
<column
name=
"project"
type=
"VARCHAR(255)"
/>
</createTable>
</changeSet>
<!-- ChangeSet для добавления внешнего ключа FK_DOCUMENT_ON_TEMPLATE -->
<changeSet
id=
"12"
author=
"yourname"
>
<addForeignKeyConstraint
baseTableName=
"document"
baseColumnNames=
"template_id"
constraintName=
"FK_DOCUMENT_ON_TEMPLATE"
referencedTableName=
"template"
referencedColumnNames=
"id"
baseTableSchemaName=
"template_schema"
referencedTableSchemaName=
"template_schema"
/>
</changeSet>
</databaseChangeLog>
src/main/resources/db/migration/V1__create_db_and_schema.sql
deleted
100644 → 0
View file @
2c8d8510
create
database
template_db
;
CREATE
SCHEMA
template_schema
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment