Init
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
spring:
|
||||
application:
|
||||
name: pcp-dynamic-plan-service
|
||||
profiles:
|
||||
default: local
|
||||
config:
|
||||
import: "configserver:"
|
||||
cloud:
|
||||
config:
|
||||
uri: ${CONFIG_SERVER_URI:http://192.168.100.160:38888}
|
||||
fail-fast: ${CONFIG_SERVER_FAIL_FAST:true}
|
||||
profile: ${SPRING_CLOUD_CONFIG_PROFILE:${SPRING_PROFILES_ACTIVE:${spring.profiles.default}}}
|
||||
label: ${SPRING_CLOUD_CONFIG_LABEL:master}
|
||||
# codec:
|
||||
# max-in-memory-size: 16MB
|
||||
datasource:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
url: jdbc:postgresql://192.168.60.68:5432/complan
|
||||
username: postgres
|
||||
password: password
|
||||
jpa:
|
||||
database-platform: org.hibernate.dialect.PostgreSQLDialect
|
||||
hibernate:
|
||||
ddl-auto: validate
|
||||
show-sql: false
|
||||
properties:
|
||||
hibernate:
|
||||
format_sql: false
|
||||
jdbc:
|
||||
batch_size: 40
|
||||
order_inserts: true
|
||||
order_updates: true
|
||||
|
||||
feign:
|
||||
client:
|
||||
config:
|
||||
default:
|
||||
connectTimeout: 5000
|
||||
readTimeout: 30000
|
||||
loggerLevel: basic
|
||||
|
||||
flyway:
|
||||
enabled: true
|
||||
locations: classpath:db/migration/pcp-complex-plan
|
||||
baseline-on-migrate: true
|
||||
ignore-migration-patterns: "*:missing"
|
||||
baseline-version: 0
|
||||
validate-on-migrate: true
|
||||
repair-on-migrate: true
|
||||
clean-disabled: true
|
||||
out-of-order: true
|
||||
schemas: public
|
||||
|
||||
logging:
|
||||
level:
|
||||
org.flywaydb: DEBUG
|
||||
org.hibernate.SQL: DEBUG
|
||||
org.hibernate.type.descriptor.sql.BasicBinder: TRACE
|
||||
org.springframework.jdbc.core: TRACE
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
enabled: true
|
||||
layout: BaseLayout
|
||||
path: /swagger/ui
|
||||
api-docs:
|
||||
enabled: true
|
||||
path: /v3/api-docs
|
||||
|
||||
complex-plan:
|
||||
observation-parameters:
|
||||
parallel-enabled: ${COMPLEX_PLAN_OBSERVATION_PARAMETERS_PARALLEL_ENABLED:true}
|
||||
chunk-size: ${COMPLEX_PLAN_OBSERVATION_PARAMETERS_CHUNK_SIZE:20}
|
||||
parallelism: ${COMPLEX_PLAN_OBSERVATION_PARAMETERS_PARALLELISM:8}
|
||||
debug-output-dir: ${COMPLEX_PLAN_OBSERVATION_PARAMETERS_DEBUG_OUTPUT_DIR:${java.io.tmpdir}/pcp-dynamic-plan-service/obsParams}
|
||||
geo-layers:
|
||||
enabled: false
|
||||
output-dir: ${java.io.tmpdir}/pcp-dynamic-plan-service/geo-layers
|
||||
@@ -0,0 +1 @@
|
||||
SELECT 'Database initialization complete' as status;
|
||||
@@ -0,0 +1,4 @@
|
||||
CREATE TABLE IF NOT EXISTS aplsettings (
|
||||
id SERIAL PRIMARY KEY, --серийный ключ
|
||||
settings TEXT --настройки автомата в виде JSON
|
||||
);
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
CREATE TABLE IF NOT EXISTS aplsettings (
|
||||
id SERIAL PRIMARY KEY, --серийный ключ
|
||||
settings TEXT --настройки автомата в виде JSON
|
||||
);
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
create table if not exists dynamic_plan_run
|
||||
(
|
||||
id uuid primary key,
|
||||
status varchar(32) not null,
|
||||
request_id uuid not null,
|
||||
satellite_ids text not null,
|
||||
calculation_start timestamp not null,
|
||||
calculation_end timestamp not null,
|
||||
created_at timestamp not null,
|
||||
started_at timestamp,
|
||||
finished_at timestamp,
|
||||
duration_ms bigint,
|
||||
result_status varchar(64),
|
||||
routes_count integer,
|
||||
result_json text,
|
||||
error_message text
|
||||
);
|
||||
|
||||
create index if not exists idx_dynamic_plan_run_status on dynamic_plan_run(status);
|
||||
create index if not exists idx_dynamic_plan_run_request_id on dynamic_plan_run(request_id);
|
||||
|
||||
create table if not exists dynamic_plan_route
|
||||
(
|
||||
id bigserial primary key,
|
||||
run_id uuid not null references dynamic_plan_run(id) on delete cascade,
|
||||
request_id uuid not null,
|
||||
satellite_id bigint not null,
|
||||
start_time timestamp not null,
|
||||
end_time timestamp not null,
|
||||
duration double precision not null,
|
||||
revolution bigint not null,
|
||||
roll double precision not null,
|
||||
contour_wkt text not null,
|
||||
route_order integer not null
|
||||
);
|
||||
|
||||
create index if not exists idx_dynamic_plan_route_run_id on dynamic_plan_route(run_id);
|
||||
create index if not exists idx_dynamic_plan_route_request_id on dynamic_plan_route(request_id);
|
||||
create index if not exists idx_dynamic_plan_route_satellite_id on dynamic_plan_route(satellite_id);
|
||||
create index if not exists idx_dynamic_plan_route_start_time on dynamic_plan_route(start_time);
|
||||
create index if not exists idx_dynamic_plan_route_run_start on dynamic_plan_route(run_id, start_time);
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
alter table dynamic_plan_run
|
||||
add column if not exists calculation_mode varchar(32) not null default 'FULL';
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
alter table dynamic_plan_run
|
||||
add column if not exists revolution_mode varchar(32) not null default 'BOTH';
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
alter table dynamic_plan_run
|
||||
add column if not exists filter_covered_routes boolean not null default false;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
alter table dynamic_plan_run
|
||||
add column if not exists min_useful_route_area_km2 double precision not null default 0.0;
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
create table if not exists dynamic_plan_interval
|
||||
(
|
||||
id bigserial primary key,
|
||||
run_id uuid not null references dynamic_plan_run(id) on delete cascade,
|
||||
request_id uuid not null,
|
||||
interval_id uuid not null,
|
||||
region_id uuid not null,
|
||||
rev_sign varchar(16) not null,
|
||||
contour_wkt text not null,
|
||||
observation_parameters_count integer not null,
|
||||
interval_order integer not null
|
||||
);
|
||||
|
||||
create index if not exists idx_dynamic_plan_interval_run_id on dynamic_plan_interval(run_id);
|
||||
create index if not exists idx_dynamic_plan_interval_request_id on dynamic_plan_interval(request_id);
|
||||
create index if not exists idx_dynamic_plan_interval_region_id on dynamic_plan_interval(region_id);
|
||||
create index if not exists idx_dynamic_plan_interval_run_order on dynamic_plan_interval(run_id, interval_order);
|
||||
Reference in New Issue
Block a user