Initial Project Commit

This commit is contained in:
Orlando M Guerreiro 2025-05-22 19:23:40 +01:00
commit a6dea9c888
2148 changed files with 173870 additions and 0 deletions

View file

@ -0,0 +1,11 @@
${AnsiColor.GREEN}███████╗ ████████╗ ██████╗ ████████╗ ██╗ ████████╗ ████████╗ ███ ██╗ ████████╗
${AnsiColor.GREEN}██╔═══██╗ ██╔═════╝ ██╔════╝ ╚══██╔══╝ ██║ ╚══██╔══╝ ██╔═════╝ ████╗ ██║ ╚══██╔══╝
${AnsiColor.GREEN}███████╔╝ ██████╗ ╚█████╗ ██║ ██║ ██║ ██████╗ ██║██╗██║ ██║
${AnsiColor.GREEN}██╔══██║ ██╔═══╝ ╚═══██╗ ██║ ██║ ██║ ██╔═══╝ ██║╚████║ ██║
${AnsiColor.GREEN}██║ ╚██╗ ████████╗ ██████╔╝ ████████╗ ████████╗ ████████╗ ████████╗ ██║ ╚███║ ██║
${AnsiColor.GREEN}╚═╝ ╚═╝ ╚═══════╝ ╚═════╝ ╚═══════╝ ╚═══════╝ ╚═══════╝ ╚═══════╝ ╚═╝ ╚══╝ ╚═╝
${AnsiColor.BRIGHT_BLUE}:: Resilient Framework :: ${resilient.version} ::
:: developed by Orlando Guerreiro :: omguerreiro@gmail.com :: +351 933 419 967 ::
:: Running Spring Boot ${spring-boot.version} :: Startup profile(s) ${spring.profiles.active} ::${AnsiColor.DEFAULT}

View file

@ -0,0 +1,10 @@
${AnsiColor.GREEN} ██╗${AnsiColor.RED} ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗
${AnsiColor.GREEN} ██║${AnsiColor.RED} ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
${AnsiColor.GREEN} ██║${AnsiColor.RED} ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝
${AnsiColor.GREEN}██╗ ██║${AnsiColor.RED} ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
${AnsiColor.GREEN}╚██████╔╝${AnsiColor.RED} ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
${AnsiColor.GREEN} ╚═════╝ ${AnsiColor.RED} ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
${AnsiColor.BRIGHT_BLUE}:: JHipster 🤓 :: Running Spring Boot ${spring-boot.version} :: Startup profile(s) ${spring.profiles.active} ::
:: https://www.jhipster.tech ::${AnsiColor.DEFAULT}

View file

@ -0,0 +1,198 @@
# ===================================================================
# Spring Boot configuration for the "dev" profile.
#
# This configuration overrides the application.yml file.
#
# More information on profiles: https://www.jhipster.tech/profiles/
# More information on configuration properties: https://www.jhipster.tech/common-application-properties/
# ===================================================================
# ===================================================================
# Standard Spring Boot properties.
# Full reference is available at:
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# ===================================================================
logging:
level:
ROOT: DEBUG
tech.jhipster: DEBUG
org.hibernate.SQL: DEBUG
org.hibernate.orm.jdbc.bind: TRACE
com.oguerreiro.resilient: DEBUG
org.opensaml: DEBUG
org.springframework.security.saml2: DEBUG
org.springframework.security: DEBUG
spring:
jpa:
show-sql: true
devtools:
restart:
enabled: true
additional-exclude: static/**
livereload:
enabled: false # we use Webpack dev server + BrowserSync for livereload
jackson:
serialization:
indent-output: true
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://localhost:3306/resilient_resilient?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
username: root
password: root
# BROWNSEA Deploy
# url: jdbc:mariadb://192.168.1.99:3306/resilient_resilient?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
# username: root
# password: root%1234
# REMEMBER to disable liquibase: "liquibase.enabled: false"
hikari:
poolName: Hikari
auto-commit: false
data-source-properties:
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
liquibase:
# Remove 'faker' if you do not want the sample data to be loaded automatically
# enabled: false
contexts: dev
mail:
host: localhost
port: 25
username:
password:
messages:
cache-duration: PT1S # 1 second, see the ISO 8601 standard
thymeleaf:
cache: false
# security: # SAMLv2 Config Placeholder
server:
port: 8081
# port: 8443
# ssl:
# key-store: classpath:keystore/keystore.p12
# key-store-password: nova#123
# key-store-type: PKCS12
# key-alias: innova-ssl-cert
# ===================================================================
# JHipster specific properties
#
# Full reference is available at: https://www.jhipster.tech/common-application-properties/
# ===================================================================
jhipster:
cache: # Cache configuration
ehcache: # Ehcache configuration
time-to-live-seconds: 3600 # By default objects stay 1 hour in the cache
max-entries: 100 # Number of objects in each cache entry
# CORS is only enabled by default with the "dev" profile
cors:
# Allow Ionic for JHipster by default (* no longer allowed in Spring Boot 2.4+)
allowed-origins: 'http://innova.oguerreiro.com,https://innova.oguerreiro.com,https://resilient.localhost,http://resilient.localhost,http://localhost:8081,https://localhost:8081,http://localhost:8100,https://localhost:8100,http://localhost:9000,https://localhost:9000,http://localhost:4200,https://localhost:4200'
# Enable CORS when running in GitHub Codespaces
allowed-origin-patterns: 'https://*.githubpreview.dev'
allowed-methods: '*'
allowed-headers: '*'
exposed-headers: 'Link,X-Total-Count,X-${jhipster.clientApp.name}-alert,X-${jhipster.clientApp.name}-error,X-${jhipster.clientApp.name}-params'
allow-credentials: true
max-age: 1800
security:
remember-me:
# security key (this key should be unique for your application, and kept secret)
key: 6436150a69ff50bcf383fbb9d974e2e7bd5c4439beaeef76e87a042d920db55f1f161147c30e01db9fd82117e47db521be8f
mail: # specific JHipster mail property, for standard properties see MailProperties
base-url: http://127.0.0.1:8081
logging:
use-json-format: false # By default, logs are not in Json format
logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration
enabled: false
host: localhost
port: 5000
ring-buffer-size: 512
# ===================================================================
# Application specific properties
# Add your own application properties here, see the ApplicationProperties class
# to have type-safe configuration, like in the JHipsterProperties above
#
# More documentation is available at:
# https://www.jhipster.tech/common-application-properties/
# ===================================================================
# application:
# ===================================================================
# Resilient specific properties
# server.http
# enabled: SpringBoot application.yml dosen't allow both http and https,
# the solution is to provide http with a custom listener.
# Set this to 'true' to enable it. Defaults to 'false'
# port: The port number to listen. Defaults to 8081.
# mock-idp
# enabled: For DEV and test pourposes a mock-idp server is provided.
# Set this to 'true' to enable it on SpringBoot startup. Defaults to 'false'
# Available only with DEV profile.
# path: The path to idp.js file. Default impl is package in \src\main\mock-idp\idp.js
# ===================================================================
resilient:
server:
http:
enabled: false
port: 8081
mock-idp:
enabled: true
path: classpath:mock-idp/idp.js
security:
saml2: # ADDED to support SAMLv2 authentication to IDP.
# Metadata endpoint ${base-url}/saml2/service-provider-metadata/mock-idp
enabled: true
idp-id: unl-idp # The id of the IDP to use. One from the collection in relyingparty.registration
base-url: https://resilient.localhost # old: https://localhost:8443
success-url: http://resilient.localhost/
failure-url: http://resilient.localhost/login
relyingparty:
registration:
mock-idp:
assertingparty:
entity-id: http://mock-idp.localhost/saml/metadata # old: http://localhost:3000/saml/metadata
single-sign-on:
url: http://mock-idp.localhost/saml/sso # old: http://localhost:3000/saml/sso
# OPTIONAL. A list of query parameters to add to single-sign-on.url. This is usefull for mock-idp, to give instructions on how to behave
query-parameters:
spUrl: https://resilient.localhost # The callback to Service Provider, after IDP authentication (OK | KO). Appends the encoded url: acs=https%3A%2F%2Fresilient.localhost%2Flogin%2Fsaml2%2Fsso%2Fmock-idp
issuerUrl: http://mock-idp.localhost/saml/metadata # The IDP entity-id. This is needed for mock-idp to build saml2 response
single-logout:
url: http://mock-idp.localhost/saml/slo # old: http://localhost:3000/saml/slo
verification:
credentials:
- certificate-location: classpath:saml/idp-public.cert
want-authn-signed: false # Validate signature in entire message response (true-validates/false-doesn't validate)
want-assertion-signed: true # Validate signature in assertions message response (true-validates/false-doesn't validate)
signing:
credentials:
- private-key-location: classpath:saml/private.key
certificate-location: classpath:saml/public.cert
unl-idp:
assertingparty:
entity-id: http://unl-idp.localhost/saml/metadata
single-sign-on:
url: http://unl-idp.localhost/saml/sso
# OPTIONAL. A list of query parameters to add to single-sign-on.url. This is usefull for mock-idp, to give instructions on how to behave
query-parameters:
spUrl: https://resilient.localhost # The callback to Service Provider, after IDP authentication (OK | KO). Appends the encoded url: acs=https%3A%2F%2Fresilient.localhost%2Flogin%2Fsaml2%2Fsso%2Fmock-idp
issuerUrl: http://unl-idp.localhost/saml/metadata # The IDP entity-id. This is needed for mock-idp to build saml2 response
single-logout:
url: http://unl-idp.localhost/saml/slo # old: http://localhost:3000/saml/slo
verification:
credentials:
- certificate-location: classpath:saml/idp-public.cert
want-authn-signed: false # Validate signature in entire message response (true-validates/false-doesn't validate)
want-assertion-signed: true # Validate signature in assertions message response (true-validates/false-doesn't validate)
signing:
credentials:
- private-key-location: classpath:saml/private.key
certificate-location: classpath:saml/public.cert

View file

@ -0,0 +1,56 @@
# ===================================================================
# This was my first implementation of SAML2. Using standard application.yml
# This was a SUCCESS. Then, I change it to be more dynamic
# Keep this has a reference
# ===================================================================
spring:
security:
saml2: # ADDED to support SAMLv2 authentication to IDP.
relyingparty:
registration:
mock-idp:
assertingparty:
entity-id: http://localhost:3000/saml/metadata
single-sign-on:
url: http://localhost:3000/saml/sso
single-logout:
url: http://localhost:3000/saml/slo
verification:
credentials:
- certificate-location: classpath:saml/idp-public.cert
want-authn-signed: false # Validate signature in entire message response (true-validates/false-doesn't validate)
want-assertion-signed: true # Validate signature in assertions message response (true-validates/false-doesn't validate)
signing:
credentials:
- private-key-location: classpath:saml/private.key
certificate-location: classpath:saml/public.cert
# ===================================================================
# This is the NEW WAY
# Custom Resilient configuration, that is loaded by saml2RelyingPartyRegistrationRepository.class
# and then, registered and configured in SecurityFilterChain
# ===================================================================
resilient:
security:
saml2: # ADDED to support SAMLv2 authentication to IDP.
enabled: true
relyingparty:
registration:
mock-idp:
assertingparty:
entity-id: http://localhost:3000/saml/metadata
single-sign-on:
url: http://localhost:3000/saml/sso
single-logout:
url: http://localhost:3000/saml/slo
verification:
credentials:
- certificate-location: classpath:saml/idp-public.cert
want-authn-signed: false # Validate signature in entire message response (true-validates/false-doesn't validate)
want-assertion-signed: true # Validate signature in assertions message response (true-validates/false-doesn't validate)
signing:
credentials:
- private-key-location: classpath:saml/private.key
certificate-location: classpath:saml/public.cert

View file

@ -0,0 +1,121 @@
# ===================================================================
# Spring Boot configuration for the "prod" profile.
#
# This configuration overrides the application.yml file.
#
# More information on profiles: https://www.jhipster.tech/profiles/
# More information on configuration properties: https://www.jhipster.tech/common-application-properties/
# ===================================================================
# ===================================================================
# Standard Spring Boot properties.
# Full reference is available at:
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# ===================================================================
logging:
level:
ROOT: INFO
tech.jhipster: INFO
com.oguerreiro.resilient: INFO
management:
prometheus:
metrics:
export:
enabled: false
spring:
devtools:
restart:
enabled: false
livereload:
enabled: false
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://localhost:3306/resilient?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
username: root
password:
hikari:
poolName: Hikari
auto-commit: false
data-source-properties:
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
# Replace by 'prod, faker' to add the faker context and have sample data loaded in production
liquibase:
contexts: prod
mail:
host: localhost
port: 25
username:
password:
thymeleaf:
cache: true
# ===================================================================
# To enable TLS in production, generate a certificate using:
# keytool -genkey -alias resilient -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650
#
# You can also use Let's Encrypt:
# See details in topic "Create a Java Keystore (.JKS) from Let's Encrypt Certificates" on https://maximilian-boehm.com/en-gb/blog
#
# Then, modify the server.ssl properties so your "server" configuration looks like:
#
# server:
# port: 443
# ssl:
# key-store: classpath:config/tls/keystore.p12
# key-store-password: password
# key-store-type: PKCS12
# key-alias: selfsigned
# # The ciphers suite enforce the security by deactivating some old and deprecated SSL cipher, this list was tested against SSL Labs (https://www.ssllabs.com/ssltest/)
# ciphers: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 ,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 ,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
# ===================================================================
server:
port: 8081
shutdown: graceful # see https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-graceful-shutdown
compression:
enabled: true
mime-types: text/html,text/xml,text/plain,text/css,application/javascript,application/json,image/svg+xml
min-response-size: 1024
# ===================================================================
# JHipster specific properties
#
# Full reference is available at: https://www.jhipster.tech/common-application-properties/
# ===================================================================
jhipster:
http:
cache: # Used by the CachingHttpHeadersFilter
timeToLiveInDays: 1461
cache: # Cache configuration
ehcache: # Ehcache configuration
time-to-live-seconds: 3600 # By default objects stay 1 hour in the cache
max-entries: 1000 # Number of objects in each cache entry
security:
remember-me:
# security key (this key should be unique for your application, and kept secret)
key: 6436150a69ff50bcf383fbb9d974e2e7bd5c4439beaeef76e87a042d920db55f1f161147c30e01db9fd82117e47db521be8f
mail: # specific JHipster mail property, for standard properties see MailProperties
base-url: http://my-server-url-to-change # Modify according to your server's URL
logging:
use-json-format: false # By default, logs are not in Json format
logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration
enabled: false
host: localhost
port: 5000
ring-buffer-size: 512
# ===================================================================
# Application specific properties
# Add your own application properties here, see the ApplicationProperties class
# to have type-safe configuration, like in the JHipsterProperties above
#
# More documentation is available at:
# https://www.jhipster.tech/common-application-properties/
# ===================================================================
# application:

View file

@ -0,0 +1,19 @@
# ===================================================================
# Activate this profile to enable TLS and HTTP/2.
#
# JHipster has generated a self-signed certificate, which will be used to encrypt traffic.
# As your browser will not understand this certificate, you will need to import it.
#
# Another (easiest) solution with Chrome is to enable the "allow-insecure-localhost" flag
# at chrome://flags/#allow-insecure-localhost
# ===================================================================
server:
ssl:
key-store: classpath:config/tls/keystore.p12
key-store-password: password
key-store-type: PKCS12
key-alias: selfsigned
ciphers: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
enabled-protocols: TLSv1.2
http2:
enabled: true

View file

@ -0,0 +1,219 @@
# ===================================================================
# Spring Boot configuration.
#
# This configuration will be overridden by the Spring profile you use,
# for example application-dev.yml if you use the "dev" profile.
#
# More information on profiles: https://www.jhipster.tech/profiles/
# More information on configuration properties: https://www.jhipster.tech/common-application-properties/
# ===================================================================
# ===================================================================
# Standard Spring Boot properties.
# Full reference is available at:
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# ===================================================================
---
# Conditionally disable springdoc on missing api-docs profile
spring:
config:
activate:
on-profile: '!api-docs'
springdoc:
api-docs:
enabled: false
---
resilient:
version: "@project.version@"
management:
endpoints:
web:
base-path: /management
exposure:
include:
- configprops
- env
- health
- info
- jhimetrics
- jhiopenapigroups
- logfile
- loggers
- prometheus
- threaddump
- caches
- liquibase
endpoint:
health:
show-details: when_authorized
roles: 'ROLE_ADMIN'
probes:
enabled: true
group:
liveness:
include: livenessState
readiness:
include: readinessState,db
jhimetrics:
enabled: true
info:
git:
mode: full
env:
enabled: true
health:
mail:
enabled: false # When using the MailService, configure an SMTP server and set this to true
prometheus:
metrics:
export:
enabled: true
step: 60
observations:
key-values:
application: ${spring.application.name}
metrics:
enable:
http: true
jvm: true
logback: true
process: true
system: true
distribution:
percentiles-histogram:
all: true
percentiles:
all: 0, 0.5, 0.75, 0.95, 0.99, 1.0
data:
repository:
autotime:
enabled: true
spring:
application:
name: resilient
profiles:
# The commented value for `active` can be replaced with valid Spring profiles to load.
# Otherwise, it will be filled in by maven when building the JAR file
# Either way, it can be overridden by `--spring.profiles.active` value passed in the commandline or `-Dspring.profiles.active` set in `JAVA_OPTS`
active: '@spring.profiles.active@'
group:
dev:
- dev
- api-docs
# Uncomment to activate TLS for the dev profile
#- tls
jmx:
enabled: false
data:
jpa:
repositories:
bootstrap-mode: deferred
jpa:
open-in-view: false
properties:
hibernate.jdbc.time_zone: UTC
hibernate.timezone.default_storage: NORMALIZE
hibernate.type.preferred_instant_jdbc_type: TIMESTAMP
hibernate.id.new_generator_mappings: true
hibernate.connection.provider_disables_autocommit: true
hibernate.cache.use_second_level_cache: true
hibernate.cache.use_query_cache: false
hibernate.generate_statistics: false
# modify batch size as necessary
hibernate.jdbc.batch_size: 25
hibernate.order_inserts: true
hibernate.order_updates: true
hibernate.query.fail_on_pagination_over_collection_fetch: true
hibernate.query.in_clause_parameter_padding: true
hibernate.javax.cache.missing_cache_strategy: create
hibernate:
ddl-auto: none
naming:
physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
messages:
basename: i18n/messages
fallback-to-system-locale: false # Added to force PT locale and NOT the system
main:
allow-bean-definition-overriding: true
mvc:
problemdetails:
enabled: true
task:
execution:
thread-name-prefix: resilient-task-
pool:
core-size: 2
max-size: 50
queue-capacity: 10000
scheduling:
thread-name-prefix: resilient-scheduling-
pool:
size: 2
thymeleaf:
mode: HTML
output:
ansi:
console-available: true
server:
servlet:
session:
cookie:
http-only: true
springdoc:
show-actuator: true
# Properties to be exposed on the /info management endpoint
info:
# Comma separated list of profiles that will trigger the ribbon to show
display-ribbon-on-profiles: 'dev'
# ===================================================================
# JHipster specific properties
#
# Full reference is available at: https://www.jhipster.tech/common-application-properties/
# ===================================================================
jhipster:
clientApp:
name: 'resilientApp'
# By default CORS is disabled. Uncomment to enable.
# cors:
# allowed-origins: "http://localhost:8100,http://localhost:9000"
# allowed-methods: "*"
# allowed-headers: "*"
# exposed-headers: "Link,X-Total-Count,X-${jhipster.clientApp.name}-alert,X-${jhipster.clientApp.name}-error,X-${jhipster.clientApp.name}-params"
# allow-credentials: true
# max-age: 1800
mail:
from: resilient@localhost
api-docs:
default-include-pattern: /api/**
management-include-pattern: /management/**
title: Resilient API
description: Resilient API documentation
version: 0.0.1
terms-of-service-url:
contact-name:
contact-url:
contact-email:
license: unlicensed
license-url:
security:
# content-security-policy: "default-src 'self'; frame-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://storage.googleapis.com; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:"
content-security-policy: "default-src 'self'; frame-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://storage.googleapis.com; style-src 'self' https://fonts.googleapis.com/ 'unsafe-inline'; img-src 'self' data:; font-src 'self' https://fonts.gstatic.com"
# ===================================================================
# Application specific properties
# Add your own application properties here, see the ApplicationProperties class
# to have type-safe configuration, like in the JHipsterProperties above
#
# More documentation is available at:
# https://www.jhipster.tech/common-application-properties/
# ===================================================================
# application:
locale: pt

View file

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
JHipster core tables.
The initial schema has the '00000000000001' id, so that it is over-written if we re-generate it.
-->
<changeSet id="00000000000001" author="jhipster">
<createTable tableName="jhi_user">
<column name="id" type="bigint" autoIncrement="true" startWith="1050">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="login" type="varchar(50)">
<constraints unique="true" nullable="false" uniqueConstraintName="ux_user_login"/>
</column>
<column name="password_hash" type="varchar(60)"/>
<column name="first_name" type="varchar(50)"/>
<column name="last_name" type="varchar(50)"/>
<column name="email" type="varchar(191)">
<constraints unique="true" nullable="true" uniqueConstraintName="ux_user_email"/>
</column>
<column name="image_url" type="varchar(256)"/>
<column name="activated" type="boolean" valueBoolean="false">
<constraints nullable="false" />
</column>
<column name="lang_key" type="varchar(10)"/>
<column name="activation_key" type="varchar(20)"/>
<column name="reset_key" type="varchar(20)"/>
<column name="created_by" type="varchar(50)">
<constraints nullable="false"/>
</column>
<column name="created_date" type="timestamp"/>
<column name="reset_date" type="timestamp">
<constraints nullable="true"/>
</column>
<column name="last_modified_by" type="varchar(50)"/>
<column name="last_modified_date" type="timestamp"/>
</createTable>
<createTable tableName="jhi_authority">
<column name="name" type="varchar(50)">
<constraints primaryKey="true" nullable="false"/>
</column>
</createTable>
<createTable tableName="jhi_user_authority">
<column name="user_id" type="bigint">
<constraints nullable="false"/>
</column>
<column name="authority_name" type="varchar(50)">
<constraints nullable="false"/>
</column>
</createTable>
<addPrimaryKey columnNames="user_id, authority_name" tableName="jhi_user_authority"/>
<createTable tableName="jhi_persistent_token">
<column name="series" type="varchar(20)">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="user_id" type="bigint"/>
<column name="token_value" type="varchar(20)">
<constraints nullable="false" />
</column>
<column name="token_date" type="date"/>
<column name="ip_address" type="varchar(39)"/>
<column name="user_agent" type="varchar(255)"/>
</createTable>
<addForeignKeyConstraint baseColumnNames="authority_name"
baseTableName="jhi_user_authority"
constraintName="fk_authority_name"
referencedColumnNames="name"
referencedTableName="jhi_authority"/>
<addForeignKeyConstraint baseColumnNames="user_id"
baseTableName="jhi_user_authority"
constraintName="fk_user_id"
referencedColumnNames="id"
referencedTableName="jhi_user"/>
<addNotNullConstraint columnName="password_hash"
columnDataType="varchar(60)"
tableName="jhi_user"/>
<addForeignKeyConstraint baseColumnNames="user_id"
baseTableName="jhi_persistent_token"
constraintName="fk_user_persistent_token"
referencedColumnNames="id"
referencedTableName="jhi_user"/>
<loadData
file="config/liquibase/data/authority.csv"
separator=";"
tableName="jhi_authority"
usePreparedStatements="true">
<column name="name" type="string"/>
</loadData>
<loadData
file="config/liquibase/data/user.csv"
separator=";"
tableName="jhi_user"
usePreparedStatements="true">
<column name="activated" type="boolean"/>
<column name="created_date" type="timestamp"/>
</loadData>
<loadData
file="config/liquibase/data/user_authority.csv"
separator=";"
tableName="jhi_user_authority"
usePreparedStatements="true">
<column name="user_id" type="numeric"/>
</loadData>
<dropDefaultValue tableName="jhi_user" columnName="created_date" columnDataType="${datetimeType}"/>
</changeSet>
<changeSet author="jhipster" id="00000000000002" context="test">
<createTable tableName="jhi_date_time_wrapper">
<column autoIncrement="true" name="id" type="BIGINT">
<constraints primaryKey="true" primaryKeyName="jhi_date_time_wrapperPK"/>
</column>
<column name="instant" type="timestamp"/>
<column name="local_date_time" type="timestamp"/>
<column name="offset_date_time" type="timestamp"/>
<column name="zoned_date_time" type="timestamp"/>
<column name="local_time" type="time"/>
<column name="offset_time" type="time"/>
<column name="local_date" type="date"/>
</createTable>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity OrganizationType.
-->
<changeSet id="20241015091307-1" author="jhipster">
<createTable tableName="organization_type" remarks="Organization Type\nThe organization type is a setup that defines the usage of the Organization level and other configurations.">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="User defined code. Must be unique in the OrganizationType">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_organization_type__code" />
</column>
<column name="name" type="varchar(255)" remarks="The name of the type. Must be unique in the system">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_organization_type__name" />
</column>
<column name="description" type="varchar(255)" remarks="A more complete description of the type. Whats the meaning of this type?">
<constraints nullable="false" />
</column>
<column name="nature" type="varchar(255)" remarks="The nature of the type">
<constraints nullable="false" />
</column>
<column name="icon" type="${blobType}" remarks="Icon image associated with this organization type. Will be used in user interface.">
<constraints nullable="true" />
</column>
<column name="icon_content_type" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<changeSet id="20241015091307-1-relations" author="jhipster">
<createTable tableName="rel_organization_type__metadata_properties">
<column name="metadata_properties_id" type="bigint">
<constraints nullable="false"/>
</column>
<column name="organization_type_id" type="bigint">
<constraints nullable="false"/>
</column>
</createTable>
<addPrimaryKey columnNames="organization_type_id, metadata_properties_id" tableName="rel_organization_type__metadata_properties"/>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015091307-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/organization_type.csv"
separator=";"
tableName="organization_type"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="code" type="string"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="nature" type="string"/>
<column name="icon" type="blob"/>
<column name="icon_content_type" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity OrganizationType.
-->
<changeSet id="20241015091307-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="organization_type_id"
baseTableName="rel_organization_type__metadata_properties"
constraintName="fk_rel_organization_type__metad__organization_type_dd_id"
referencedColumnNames="id"
referencedTableName="organization_type"
/>
<addForeignKeyConstraint baseColumnNames="metadata_properties_id"
baseTableName="rel_organization_type__metadata_properties"
constraintName="fk_rel_organization_type__metad__metadata_properties_2b_id"
referencedColumnNames="id"
referencedTableName="metadata_property"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity Organization.
-->
<changeSet id="20241015091407-1" author="jhipster">
<createTable tableName="organization" remarks="Organization\nHierarchical organigram of the organization.">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="User defined code. Must be unique in the Organization">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_organization__code" />
</column>
<column name="name" type="varchar(255)" remarks="The name of the Organization entry. Allows duplicate name&apos;s, but NOT duplicate code&apos;s.">
<constraints nullable="false" />
</column>
<column name="image" type="${blobType}">
<constraints nullable="true" />
</column>
<column name="image_content_type" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="input_inventory" type="boolean">
<constraints nullable="true" />
</column>
<column name="output_inventory" type="boolean">
<constraints nullable="true" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="user_id" type="bigint">
<constraints nullable="true" unique="true" uniqueConstraintName="ux_organization__user_id" />
</column>
<column name="parent_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="organization_type_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015091407-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/organization.csv"
separator=";"
tableName="organization"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="code" type="string"/>
<column name="name" type="string"/>
<column name="image" type="blob"/>
<column name="image_content_type" type="string"/>
<column name="input_inventory" type="boolean"/>
<column name="output_inventory" type="boolean"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity Organization.
-->
<changeSet id="20241015091407-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="user_id"
baseTableName="organization"
constraintName="fk_organization__user_id"
referencedColumnNames="id"
referencedTableName="jhi_user"
/>
<addForeignKeyConstraint baseColumnNames="parent_id"
baseTableName="organization"
constraintName="fk_organization__parent_id"
referencedColumnNames="id"
referencedTableName="organization"
/>
<addForeignKeyConstraint baseColumnNames="organization_type_id"
baseTableName="organization"
constraintName="fk_organization__organization_type_id"
referencedColumnNames="id"
referencedTableName="organization_type"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity MetadataProperty.
-->
<changeSet id="20241015091507-1" author="jhipster">
<createTable tableName="metadata_property" remarks="Metadata Property\nConfiguration of a metadata property. Defines its type and a description of its usage.">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_metadata_property__code" />
</column>
<column name="name" type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="mandatory" type="boolean">
<constraints nullable="true" />
</column>
<column name="metadata_type" type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="pattern" type="varchar(255)" remarks="Regex pattern for validation (optional). Only applies when the value is not empty.">
<constraints nullable="true" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015091507-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/metadata_property.csv"
separator=";"
tableName="metadata_property"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="code" type="string"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="mandatory" type="boolean"/>
<column name="metadata_type" type="string"/>
<column name="pattern" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity MetadataValue.
-->
<changeSet id="20241015091607-1" author="jhipster">
<createTable tableName="metadata_value" remarks="Metadata Value\nThe value of a metadata property.">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="metadata_property_code" type="varchar(255)" remarks="Functional relational key to MetadataProperty">
<constraints nullable="false" />
</column>
<column name="target_domain_key" type="varchar(255)" remarks="The target domain key that this MetadataValue belongs. Its a class name or a key provided by the consumer. &lt;br&gt;\nUsed with targetDomainId to create as unique relation with the target domain\n@see targetDomainId">
<constraints nullable="false" />
</column>
<column name="target_domain_id" type="bigint" remarks="The target domain Id that this MetadataValue belongs. &lt;br&gt;\nUsed with targetDomainKey to create as unique relation with the target domain\n@see targetDomainKey">
<constraints nullable="false" />
</column>
<column name="value" type="varchar(255)" remarks="The value of the MetadataProperty, persisted as a string. &lt;br&gt;">
<constraints nullable="true" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015091607-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/metadata_value.csv"
separator=";"
tableName="metadata_value"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="metadata_property_code" type="string"/>
<column name="target_domain_key" type="string"/>
<column name="target_domain_id" type="numeric"/>
<column name="value" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity UnitType.
-->
<changeSet id="20241015091707-1" author="jhipster">
<createTable tableName="unit_type" remarks="UnitType\nType of measure unit types. Convertions can only be done within Unit&apos;s of the same UnitType">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="varchar(255)">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_unit_type__name" />
</column>
<column name="description" type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="value_type" type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015091707-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/unit_type.csv"
separator=";"
tableName="unit_type"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="value_type" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity Unit.
-->
<changeSet id="20241015091807-1" author="jhipster">
<createTable tableName="unit" remarks="Unit">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="Required code to use in integrations">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_unit__code" />
</column>
<column name="symbol" type="varchar(255)" remarks="Math symbol that is usually used as sufix for this unit. Eg. &apos;m3&apos; for square metters.">
<constraints nullable="false" />
</column>
<column name="name" type="varchar(255)" remarks="Math name for this unit. Eg. &apos;Square metters&apos;.">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)">
<constraints nullable="true" />
</column>
<column name="convertion_rate" type="decimal(21,2)" remarks="The convertion rate (CR), relative to the base unit.\nThis values awnsers the question: When the base unit is 1 (one), whats the value of this unit measure ?\nEx: How many Ml (miligrams) 1Kg has? 1000\nThe formula to convert between any value unit the scale is:\n&lt;Value&gt;*CR(target unit)/CR(source unit)">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="unit_type_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015091807-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/unit.csv"
separator=";"
tableName="unit"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="code" type="string"/>
<column name="symbol" type="string"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="convertion_rate" type="numeric"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity Unit.
-->
<changeSet id="20241015091807-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="unit_type_id"
baseTableName="unit"
constraintName="fk_unit__unit_type_id"
referencedColumnNames="id"
referencedTableName="unit_type"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity UnitConverter.
-->
<changeSet id="20241015091907-1" author="jhipster">
<createTable tableName="unit_converter" remarks="Unit Converter">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="convertion_formula" type="varchar(255)" remarks="The convertion formula to convert the fromUnit into the toUnit.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="from_unit_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="to_unit_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015091907-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/unit_converter.csv"
separator=";"
tableName="unit_converter"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="convertion_formula" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity UnitConverter.
-->
<changeSet id="20241015091907-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="from_unit_id"
baseTableName="unit_converter"
constraintName="fk_unit_converter__from_unit_id"
referencedColumnNames="id"
referencedTableName="unit"
/>
<addForeignKeyConstraint baseColumnNames="to_unit_id"
baseTableName="unit_converter"
constraintName="fk_unit_converter__to_unit_id"
referencedColumnNames="id"
referencedTableName="unit"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity VariableScope.
-->
<changeSet id="20241015092007-1" author="jhipster">
<createTable tableName="variable_scope" remarks="Variable Scope\nExample: GEE Scope 1/2/3 or General Info">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="Unique key, user defined.\nBe aware, that this will be used to create the Variable.code\nNOTE: The field type is string, but restricted to only numbers">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_variable_scope__code" />
</column>
<column name="name" type="varchar(255)" remarks="The name or title for this scope">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)" remarks="A description or usage of this scope">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015092007-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/variable_scope.csv"
separator=";"
tableName="variable_scope"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="code" type="string"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity VariableCategory.
-->
<changeSet id="20241015092107-1" author="jhipster">
<createTable tableName="variable_category" remarks="Variable Category\nSub-division of VariableScope in Categories">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="Unique key, user defined.\nBe aware, that this will be used to create the Variable.code\nNOTE: The field type is string, but restricted to only numbers">
<constraints nullable="false" />
</column>
<column name="name" type="varchar(255)" remarks="The name or title for this category">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)" remarks="A description or usage of this category">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="variable_scope_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015092107-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/variable_category.csv"
separator=";"
tableName="variable_category"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="code" type="string"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity VariableCategory.
-->
<changeSet id="20241015092107-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="variable_scope_id"
baseTableName="variable_category"
constraintName="fk_variable_category__variable_scope_id"
referencedColumnNames="id"
referencedTableName="variable_scope"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity Variable.
-->
<changeSet id="20241015092207-1" author="jhipster">
<createTable tableName="variable" remarks="Variable Definition (GEE variable classification)">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="Unique key, composed by: &lt;br&gt;\nVariableScope.code + VariableCategory.code + &lt;index&gt;\nNOTA: User will provide the index property, and the software will create the code\nindex and code are NOT changeable">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_variable__code" />
</column>
<column name="variable_index" type="integer" remarks="Variable index">
<constraints nullable="false" />
</column>
<column name="name" type="varchar(255)" remarks="The name or title for the variable">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)" remarks="The descriptions of the variable. Its meaning. Its usage.">
<constraints nullable="false" />
</column>
<column name="input" type="boolean" remarks="Defines this variable as input. Values will be inserted for this variable">
<constraints nullable="false" />
</column>
<column name="input_mode" type="varchar(255)" remarks="Defines the way of input. See the enum for instructions.">
<constraints nullable="false" />
</column>
<column name="output" type="boolean" remarks="Defines this variable as output. This variable will be evaluated for output">
<constraints nullable="false" />
</column>
<column name="output_formula" type="varchar(255)" remarks="The formula to calculate the output valut of the variable. Mandatory when output==TRUE">
<constraints nullable="true" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="base_unit_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="variable_scope_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="variable_category_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015092207-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/variable.csv"
separator=";"
tableName="variable"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="code" type="string"/>
<column name="variable_index" type="numeric"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="input" type="boolean"/>
<column name="input_mode" type="string"/>
<column name="output" type="boolean"/>
<column name="output_formula" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity Variable.
-->
<changeSet id="20241015092207-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="base_unit_id"
baseTableName="variable"
constraintName="fk_variable__base_unit_id"
referencedColumnNames="id"
referencedTableName="unit"
/>
<addForeignKeyConstraint baseColumnNames="variable_scope_id"
baseTableName="variable"
constraintName="fk_variable__variable_scope_id"
referencedColumnNames="id"
referencedTableName="variable_scope"
/>
<addForeignKeyConstraint baseColumnNames="variable_category_id"
baseTableName="variable"
constraintName="fk_variable__variable_category_id"
referencedColumnNames="id"
referencedTableName="variable_category"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity VariableUnits.
-->
<changeSet id="20241015092307-1" author="jhipster">
<createTable tableName="variable_units" remarks="Variable allowed input units. Also defines the converters needed if the">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="variable_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="unit_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015092307-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/variable_units.csv"
separator=";"
tableName="variable_units"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity VariableUnits.
-->
<changeSet id="20241015092307-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="variable_id"
baseTableName="variable_units"
constraintName="fk_variable_units__variable_id"
referencedColumnNames="id"
referencedTableName="variable"
/>
<addForeignKeyConstraint baseColumnNames="unit_id"
baseTableName="variable_units"
constraintName="fk_variable_units__unit_id"
referencedColumnNames="id"
referencedTableName="unit"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity VariableClass.
-->
<changeSet id="20241015092407-1" author="jhipster">
<createTable tableName="variable_class" remarks="Variable Class\nA sub-variable classification. Example: Variable=FUEL CONSUMPTIOM; CLASS=GASOLINE; OR ELECTRICAL; ETC...">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="Code of the class. Must be unique within the Variavle">
<constraints nullable="false" />
</column>
<column name="name" type="varchar(255)" remarks="Human name of the class. Must be unique within the Variable, because it will be used as key for the Excel integration data.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="variable_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015092407-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/variable_class.csv"
separator=";"
tableName="variable_class"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="code" type="string"/>
<column name="name" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity VariableClass.
-->
<changeSet id="20241015092407-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="variable_id"
baseTableName="variable_class"
constraintName="fk_variable_class__variable_id"
referencedColumnNames="id"
referencedTableName="variable"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity Period.
-->
<changeSet id="20241015092507-1" author="jhipster">
<createTable tableName="period" remarks="Period">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="varchar(255)" remarks="Name of the period">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)" remarks="Description for the period">
<constraints nullable="true" />
</column>
<column name="begin_date" type="date" remarks="Period start date">
<constraints nullable="false" />
</column>
<column name="end_date" type="date" remarks="Period end date">
<constraints nullable="false" />
</column>
<column name="state" type="varchar(255)" remarks="State of the Period">
<constraints nullable="false" />
</column>
<column name="creation_date" type="${datetimeType}" remarks="The creation date (insert). When the data was inserted into the system.">
<constraints nullable="false" />
</column>
<column name="creation_username" type="varchar(255)" remarks="The actual username logged into the system, that inserted the data. NOT a reference to the user, but the login username.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
<dropDefaultValue tableName="period" columnName="creation_date" columnDataType="${datetimeType}"/>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015092507-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/period.csv"
separator=";"
tableName="period"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="begin_date" type="date"/>
<column name="end_date" type="date"/>
<column name="state" type="string"/>
<column name="creation_date" type="date"/>
<column name="creation_username" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity PeriodVersion.
-->
<changeSet id="20241015092607-1" author="jhipster">
<createTable tableName="period_version" remarks="Period versions\nAlways have at least one version.">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="varchar(255)" remarks="Name of the version">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)" remarks="Description for the version">
<constraints nullable="true" />
</column>
<column name="period_version" type="integer" remarks="Period version (sequencial)">
<constraints nullable="false" />
</column>
<column name="state" type="varchar(255)" remarks="State of the Period">
<constraints nullable="false" />
</column>
<column name="creation_date" type="${datetimeType}" remarks="The creation date (insert). When the data was inserted into the system.">
<constraints nullable="false" />
</column>
<column name="creation_username" type="varchar(255)" remarks="The actual username logged into the system, that inserted the data. NOT a reference to the user, but the login username.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="period_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
<dropDefaultValue tableName="period_version" columnName="creation_date" columnDataType="${datetimeType}"/>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015092607-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/period_version.csv"
separator=";"
tableName="period_version"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="period_version" type="numeric"/>
<column name="state" type="string"/>
<column name="creation_date" type="date"/>
<column name="creation_username" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity PeriodVersion.
-->
<changeSet id="20241015092607-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="period_id"
baseTableName="period_version"
constraintName="fk_period_version__period_id"
referencedColumnNames="id"
referencedTableName="period"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity InputData.
-->
<changeSet id="20241015092707-1" author="jhipster">
<createTable tableName="input_data" remarks="Input data Values\nThe values inserted from:\n- Each Organic Unit\n- Variable\n- PeriodVersion">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="source_value" type="decimal(21,2)" remarks="The value of the data in the source Unit. This might be different from the Variable baseUnit. @see variableValue and variableUnit">
<constraints nullable="false" />
</column>
<column name="variable_value" type="decimal(21,2)" remarks="The value of the data converted to the variable baseUnit.">
<constraints nullable="false" />
</column>
<column name="imputed_value" type="decimal(21,2)" remarks="The value that the InputData.owner is accounted for.\nIn case a variableValue is distributed to other Organization&apos;s (InputData.source==DataSources.DISTRIB)\n, this will have the value to consider when calculating the final inventory value for the variable">
<constraints nullable="false" />
</column>
<column name="source_type" type="varchar(255)" remarks="What was the source of this data ?">
<constraints nullable="false" />
</column>
<column name="data_date" type="date" remarks="The date that this data relates to.\nEg. energy consumptium happens every month, this should be the date of invoice\n[optional]">
<constraints nullable="true" />
</column>
<column name="change_date" type="${datetimeType}" remarks="Last change date">
<constraints nullable="false" />
</column>
<column name="change_username" type="varchar(255)" remarks="The actual username logged into the system, that last changed the data">
<constraints nullable="false" />
</column>
<column name="data_source" type="varchar(255)" remarks="Where this data originates from? Where were the data collected ?">
<constraints nullable="true" />
</column>
<column name="data_user" type="varchar(255)" remarks="Who collected the data ?">
<constraints nullable="true" />
</column>
<column name="data_comments" type="varchar(255)" remarks="Comments added by the user">
<constraints nullable="true" />
</column>
<column name="creation_date" type="${datetimeType}" remarks="The creation date (insert). When the data was inserted into the system.">
<constraints nullable="false" />
</column>
<column name="creation_username" type="varchar(255)" remarks="The actual username logged into the system, that inserted the data. NOT a reference to the user, but the login username.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="variable_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="period_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="period_version_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="source_unit_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="unit_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="owner_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="source_input_data_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="source_input_data_upload_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
<dropDefaultValue tableName="input_data" columnName="change_date" columnDataType="${datetimeType}"/>
<dropDefaultValue tableName="input_data" columnName="creation_date" columnDataType="${datetimeType}"/>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015092707-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/input_data.csv"
separator=";"
tableName="input_data"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="source_value" type="numeric"/>
<column name="variable_value" type="numeric"/>
<column name="imputed_value" type="numeric"/>
<column name="source_type" type="string"/>
<column name="data_date" type="date"/>
<column name="change_date" type="date"/>
<column name="change_username" type="string"/>
<column name="data_source" type="string"/>
<column name="data_user" type="string"/>
<column name="data_comments" type="string"/>
<column name="creation_date" type="date"/>
<column name="creation_username" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity InputData.
-->
<changeSet id="20241015092707-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="variable_id"
baseTableName="input_data"
constraintName="fk_input_data__variable_id"
referencedColumnNames="id"
referencedTableName="variable"
/>
<addForeignKeyConstraint baseColumnNames="period_id"
baseTableName="input_data"
constraintName="fk_input_data__period_id"
referencedColumnNames="id"
referencedTableName="period"
/>
<addForeignKeyConstraint baseColumnNames="period_version_id"
baseTableName="input_data"
constraintName="fk_input_data__period_version_id"
referencedColumnNames="id"
referencedTableName="period_version"
/>
<addForeignKeyConstraint baseColumnNames="source_unit_id"
baseTableName="input_data"
constraintName="fk_input_data__source_unit_id"
referencedColumnNames="id"
referencedTableName="unit"
/>
<addForeignKeyConstraint baseColumnNames="unit_id"
baseTableName="input_data"
constraintName="fk_input_data__unit_id"
referencedColumnNames="id"
referencedTableName="unit"
/>
<addForeignKeyConstraint baseColumnNames="owner_id"
baseTableName="input_data"
constraintName="fk_input_data__owner_id"
referencedColumnNames="id"
referencedTableName="organization"
/>
<addForeignKeyConstraint baseColumnNames="source_input_data_id"
baseTableName="input_data"
constraintName="fk_input_data__source_input_data_id"
referencedColumnNames="id"
referencedTableName="input_data"
/>
<addForeignKeyConstraint baseColumnNames="source_input_data_upload_id"
baseTableName="input_data"
constraintName="fk_input_data__source_input_data_upload_id"
referencedColumnNames="id"
referencedTableName="input_data_upload"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity InputDataUpload.
-->
<changeSet id="20241015092807-1" author="jhipster">
<createTable tableName="input_data_upload" remarks="Input data upload file\nUsers can upload an Excel file with InputData that will automatically insert values in the table InputData">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="title" type="varchar(255)" remarks="A simple text with a title, for human reference and better relation">
<constraints nullable="false" />
</column>
<column name="data_file" type="${blobType}" remarks="An Excel file, that must match a template for input">
<constraints nullable="false" />
</column>
<column name="data_file_content_type" type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="upload_file_name" type="varchar(255)" remarks="The name of the uploaded Excel file">
<constraints nullable="true" />
</column>
<column name="disk_file_name" type="varchar(255)" remarks="The generated name of the Excel file, used to save to disk">
<constraints nullable="true" />
</column>
<column name="type" type="varchar(255)" remarks="Type of the Upload">
<constraints nullable="false" />
</column>
<column name="state" type="varchar(255)" remarks="State of the Upload">
<constraints nullable="false" />
</column>
<column name="comments" type="varchar(255)" remarks="Optional comments">
<constraints nullable="true" />
</column>
<column name="creation_date" type="${datetimeType}" remarks="The creation date (insert). When the data was inserted into the system.">
<constraints nullable="false" />
</column>
<column name="creation_username" type="varchar(255)" remarks="The actual username logged into the system, that inserted the data. NOT a reference to the user, but the login username.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="period_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="period_version_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="owner_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
<dropDefaultValue tableName="input_data_upload" columnName="creation_date" columnDataType="${datetimeType}"/>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015092807-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/input_data_upload.csv"
separator=";"
tableName="input_data_upload"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="title" type="string"/>
<column name="data_file" type="blob"/>
<column name="data_file_content_type" type="string"/>
<column name="upload_file_name" type="string"/>
<column name="disk_file_name" type="string"/>
<column name="type" type="string"/>
<column name="state" type="string"/>
<column name="comments" type="string"/>
<column name="creation_date" type="date"/>
<column name="creation_username" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity InputDataUpload.
-->
<changeSet id="20241015092807-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="period_id"
baseTableName="input_data_upload"
constraintName="fk_input_data_upload__period_id"
referencedColumnNames="id"
referencedTableName="period"
/>
<addForeignKeyConstraint baseColumnNames="period_version_id"
baseTableName="input_data_upload"
constraintName="fk_input_data_upload__period_version_id"
referencedColumnNames="id"
referencedTableName="period_version"
/>
<addForeignKeyConstraint baseColumnNames="owner_id"
baseTableName="input_data_upload"
constraintName="fk_input_data_upload__owner_id"
referencedColumnNames="id"
referencedTableName="organization"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity InputDataUploadLog.
-->
<changeSet id="20241015092907-1" author="jhipster">
<createTable tableName="input_data_upload_log" remarks="Input data upload file\nUsers can upload an Excel file with InputData that will automatically insert values in the table InputData">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="log_message" type="varchar(255)" remarks="The log of the event. Eg. &quot;InputDataUpload created&quot;; &quot;InputDataUpload replaced with new file&quot;; &quot;125 records inserted&quot;; &quot;User XPTO confirmed the file replacement.&quot;">
<constraints nullable="false" />
</column>
<column name="creation_date" type="${datetimeType}" remarks="The creation date (insert). When the data was inserted into the system.">
<constraints nullable="false" />
</column>
<column name="creation_username" type="varchar(255)" remarks="The actual username logged into the system, that inserted the data. NOT a reference to the user, but the login username.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="input_data_upload_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
<dropDefaultValue tableName="input_data_upload_log" columnName="creation_date" columnDataType="${datetimeType}"/>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015092907-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/input_data_upload_log.csv"
separator=";"
tableName="input_data_upload_log"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="log_message" type="string"/>
<column name="creation_date" type="date"/>
<column name="creation_username" type="string"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity InputDataUploadLog.
-->
<changeSet id="20241015092907-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="input_data_upload_id"
baseTableName="input_data_upload_log"
constraintName="fk_input_data_upload_log__input_data_upload_id"
referencedColumnNames="id"
referencedTableName="input_data_upload"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity OutputData.
-->
<changeSet id="20241015093007-1" author="jhipster">
<createTable tableName="output_data" remarks="Output data Values\nThe values calculated using the Variable.outputFormula, for all variables with Variable.output==TRUE.">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="value" type="decimal(21,2)" remarks="The evaluated value, calculated by Variable.outputFormula. This will probably represent an emission value.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<column name="variable_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="period_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="period_version_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="base_unit_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
<!--
Load sample data generated with Faker.js
- This data can be easily edited using a CSV editor (or even MS Excel) and
is located in the 'src/main/resources/config/liquibase/fake-data' directory
- By default this data is applied when running with the JHipster 'dev' profile.
This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
Spring Boot configuration key.
-->
<changeSet id="20241015093007-1-data" author="jhipster" context="faker">
<loadData
file="config/liquibase/fake-data/output_data.csv"
separator=";"
tableName="output_data"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="value" type="numeric"/>
<column name="version" type="numeric"/>
<!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity OutputData.
-->
<changeSet id="20241015093007-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="variable_id"
baseTableName="output_data"
constraintName="fk_output_data__variable_id"
referencedColumnNames="id"
referencedTableName="variable"
/>
<addForeignKeyConstraint baseColumnNames="period_id"
baseTableName="output_data"
constraintName="fk_output_data__period_id"
referencedColumnNames="id"
referencedTableName="period"
/>
<addForeignKeyConstraint baseColumnNames="period_version_id"
baseTableName="output_data"
constraintName="fk_output_data__period_version_id"
referencedColumnNames="id"
referencedTableName="period_version"
/>
<addForeignKeyConstraint baseColumnNames="base_unit_id"
baseTableName="output_data"
constraintName="fk_output_data__base_unit_id"
referencedColumnNames="id"
referencedTableName="unit"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!-- Import standard data for OrganizationType -->
<changeSet id="20241015105339-organizationtype-data" author="default">
<loadData
file="config/liquibase/fill-data/organization_type.csv"
separator=";"
tableName="organization_type"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="name" type="string"/>
<column name="code" type="string"/>
<column name="nature" type="string"/>
</loadData>
</changeSet>
<!-- Import standard data for Organization -->
<changeSet id="20241015105339-organization-data" author="default">
<loadData
file="config/liquibase/fill-data/organization.csv"
separator=";"
tableName="organization"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="organization_type_id" type="numeric"/>
<column name="parent_id" type="numeric"/>
<column name="name" type="string"/>
<column name="code" type="string"/>
</loadData>
</changeSet>
<!-- Import standard data for MetadataProperty -->
<changeSet id="20241015105339-metadataproperty-data" author="default">
<loadData
file="config/liquibase/fill-data/metadata_property.csv"
separator=";"
tableName="metadata_property"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="code" type="string"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="mandatory" type="boolean"/>
<column name="metadata_type" type="string"/>
<column name="pattern" type="string"/>
</loadData>
</changeSet>
<!-- Import standard data for UnitType -->
<changeSet id="20241015105339-unittype-data" author="default">
<loadData
file="config/liquibase/fill-data/unit_type.csv"
separator=";"
tableName="unit_type"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
</loadData>
</changeSet>
<!-- Import standard data for Unit -->
<changeSet id="20241015105339-unit-data" author="default">
<loadData
file="config/liquibase/fill-data/unit.csv"
separator=";"
tableName="unit"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="unit_type_id" type="numeric"/>
<column name="symbol" type="string"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="convertion_rate" type="numeric"/>
</loadData>
</changeSet>
<!-- Import standard data for VariableScope -->
<changeSet id="20241015105339-variablescope-data" author="default">
<loadData
file="config/liquibase/fill-data/var_scope.csv"
separator=";"
tableName="variable_scope"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="code" type="string"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
</loadData>
</changeSet>
<!-- Import standard data for VariableCategory -->
<changeSet id="20241015105339-variablecategory-data" author="default">
<loadData
file="config/liquibase/fill-data/var_category.csv"
separator=";"
tableName="variable_category"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="variable_scope_id" type="bigint"/>
<column name="code" type="string"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="AUX_IGNORE" type="skip"/>
</loadData>
</changeSet>
<!-- Import standard data for Variable -->
<changeSet id="20241015105339-variable-data" author="default">
<loadData
file="config/liquibase/fill-data/variable.csv"
separator=";"
tableName="variable"
usePreparedStatements="true">
<column name="id" type="numeric"/>
<column name="variable_scope_id" type="bigint"/>
<column name="variable_category_id" type="bigint"/>
<column name="variable_index" type="numeric"/>
<column name="code" type="string"/>
<column name="name" type="string"/>
<column name="description" type="string"/>
<column name="AUX_Scope_Code" type="skip"/>
<column name="AUX_Scope_Id" type="skip"/>
<column name="AUX_Category_Code" type="skip"/>
<column name="AUX_Category_Code_Key" type="skip"/>
<column name="AUX_Category_Id" type="skip"/>
</loadData>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity VariableClassType.
-->
<changeSet id="20241024175407-1" author="omg">
<createTable tableName="variable_class_type" remarks="Variable Class Type\nDfines a group of VariableClasse's to be reused in several variables.">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="Code of the variable class type. Must be unique.">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_variable_class_type__code" />
</column>
<column name="name" type="varchar(255)" remarks="The name for the classe type. This is internaly displayed only.">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)" remarks="Description for the variable class type">
<constraints nullable="true" />
</column>
<column name="label" type="varchar(255)" remarks="The label to present to the end user. It can be overriden by Variable.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity Variable.
Add FK to VariableClassType
-->
<changeSet id="20241025180907-1" author="omg">
<!-- Step 1: Add the column to the existing table -->
<addColumn tableName="variable">
<column name="variable_class_type_id" type="bigint" />
</addColumn>
<!-- Step 2: Add foreign key constraint to link it with the referenced table -->
<addForeignKeyConstraint
baseTableName="variable"
baseColumnNames="variable_class_type_id"
referencedTableName="variable_class_type"
referencedColumnNames="id"
constraintName="fk_variable__variable_class_type_id"/>
</changeSet>
<!--
Alter the entity Variable.
Add FK to VariableClassType
-->
<changeSet id="20241025180907-2" author="omg">
<addColumn tableName="variable">
<column name="variable_class_mandatory" type="boolean" />
<column name="variable_class_label" type="varchar(255)" />
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Clear all data from VariableClass table
-->
<changeSet id="20241025234007-1" author="omg">
<delete tableName="variable_class"/>
</changeSet>
<!--
Alter the entity VariableClass.
Drop connection to Variable table
-->
<changeSet id="20241025234007-2" author="omg">
<!-- Step 1: Drop the foreign key constraint -->
<dropForeignKeyConstraint
baseTableName="variable_class"
constraintName="fk_variable_class__variable_id"/>
<!-- Step 2: Drop the column -->
<dropColumn tableName="variable_class" columnName="variable_id"/>
</changeSet>
<!--
Alter the entity VariableClass.
Connect to VariableClassType
-->
<changeSet id="20241025180907-3" author="omg">
<addColumn tableName="variable_class">
<column name="variable_class_type_id" type="bigint">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
<!--
Make FK to the new parent : VariableClassType
-->
<changeSet id="20241025180907-4" author="omg">
<addForeignKeyConstraint baseColumnNames="variable_class_type_id"
baseTableName="variable_class"
constraintName="fk_variable_class__variable_class_type_id"
referencedColumnNames="id"
referencedTableName="variable_class_type"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity VariableUnits.
Add foreign relation with UnitConverter
-->
<changeSet id="20241027235307-1" author="omg">
<!-- Step 1: Add the column to the existing table -->
<addColumn tableName="variable_units">
<column name="unit_converter_id" type="bigint" />
</addColumn>
<!-- Step 2: Add foreign key constraint to link it with the referenced table -->
<addForeignKeyConstraint
baseTableName="variable_units"
baseColumnNames="unit_converter_id"
referencedTableName="unit_converter"
referencedColumnNames="id"
constraintName="fk_variable_units__unit_converter_id"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity Variable.
Set column base_unit_id mandatory (NOT NULL)
-->
<changeSet id="20241026005807-1" author="omg">
<addNotNullConstraint tableName="variable" columnName="base_unit_id" columnDataType="bigint"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity VariableClass.
Add unique constraint with columns: variable_class_type_id | code
"A Code can't be repeated in the same Variable ClassType"
-->
<changeSet id="20241031074807-1" author="omg">
<addUniqueConstraint
columnNames="variable_class_type_id, code"
constraintName="un_variable_class__variable_class_type_id__code"
tableName="variable_class"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity InputData.
Set columns to NOT NULL : variable_id, period_id, period_version_id, source_unit_id, unit_id, owner_id
-->
<changeSet id="20241101142307-1" author="omg">
<addNotNullConstraint tableName="input_data" columnDataType = "bigint" columnName="variable_id" />
<addNotNullConstraint tableName="input_data" columnDataType = "bigint" columnName="period_id" />
<addNotNullConstraint tableName="input_data" columnDataType = "bigint" columnName="period_version_id" />
<addNotNullConstraint tableName="input_data" columnDataType = "bigint" columnName="source_unit_id" />
<addNotNullConstraint tableName="input_data" columnDataType = "bigint" columnName="unit_id" />
<addNotNullConstraint tableName="input_data" columnDataType = "bigint" columnName="owner_id" />
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity InputData.
Remove relation with period_version.
-->
<changeSet id="20241110130700-1" author="omg">
<!-- Step 1: Drop the foreign key constraint -->
<dropForeignKeyConstraint
baseTableName="input_data"
constraintName="fk_input_data__period_version_id"/>
<!-- Step 2: Drop the column -->
<dropColumn columnName="period_version_id"
tableName="input_data" >
</dropColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity InputDataUpload.
Remove relation with period_version.
-->
<changeSet id="20241110131000-1" author="omg">
<!-- Step 1: Drop the foreign key constraint -->
<dropForeignKeyConstraint
baseTableName="input_data_upload"
constraintName="fk_input_data_upload__period_version_id"/>
<!-- Step 2: Drop the column -->
<dropColumn columnName="period_version_id"
tableName="input_data_upload" >
</dropColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity EmissionFactor.
-->
<changeSet id="20241119003525-1" author="jhipster">
<createTable tableName="emission_factor" remarks="Emission Factor">
<column name="id" type="bigint" autoIncrement="true" startWith="1500">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="Unique key, within the year">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_emission_factor__code" />
</column>
<column name="name" type="varchar(255)" remarks="The name or title for the Emission factor">
<constraints nullable="false" />
</column>
<column name="unit" type="varchar(255)" remarks="The unit of the Emission Factor.">
<constraints nullable="false" />
</column>
<column name="value" type="decimal(21,2)" remarks="The value of the factor.">
<constraints nullable="false" />
</column>
<column name="source" type="varchar(255)" remarks="The source of the Emission Factor.">
<constraints nullable="true" />
</column>
<column name="comments" type="varchar(255)" remarks="Comments">
<constraints nullable="true" />
</column>
<column name="variable_scope_id" type="bigint">
<constraints nullable="true" />
</column>
<column name="variable_category_id" type="bigint">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->
</databaseChangeLog>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the constraints for entity EmissionFactor.
-->
<changeSet id="20241119003525-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="variable_scope_id"
baseTableName="emission_factor"
constraintName="fk_emission_factor__variable_scope_id"
referencedColumnNames="id"
referencedTableName="variable_scope"
/>
<addForeignKeyConstraint baseColumnNames="variable_category_id"
baseTableName="emission_factor"
constraintName="fk_emission_factor__variable_category_id"
referencedColumnNames="id"
referencedTableName="variable_category"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity Unit.
Change the column convertion_rate decimal precision
-->
<changeSet id="20241119230505-1" author="omg">
<modifyDataType tableName="unit" columnName="convertion_rate" newDataType="decimal(41,21)" />
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Atered the entity EmissionFactor.
* Data type change for column value, from decimal(21,2) to decimal(21,4)
* Add mandatory column: year
-->
<changeSet id="20241128171125-1" author="omg">
<modifyDataType tableName="emission_factor" columnName="value" newDataType="decimal(21,4)" />
</changeSet>
<changeSet id="20241128171125-2" author="omg">
<addColumn tableName="emission_factor">
<column name="year" type="int" afterColumn="code">
<constraints nullable="false" />
</column>
</addColumn>
</changeSet>
<changeSet id="20241128171125-3" author="omg">
<dropUniqueConstraint
tableName="emission_factor"
constraintName="ux_emission_factor__code"/>
</changeSet>
<changeSet id="20241128171125-4" author="omg">
<addUniqueConstraint
tableName="emission_factor"
columnNames="year,code"
constraintName="ux_emission_factor__year__code"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity InputData.
Add columns for Class persistance
-->
<changeSet id="20241205125307-1" author="omg">
<addColumn tableName="input_data">
<column name="variable_class_code" type="varchar(255)" />
</addColumn>
<addColumn tableName="input_data">
<column name="variable_class_name" type="varchar(255)" />
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity Variable.
Change column input_mode and variable_index to NULLABLE
-->
<changeSet id="20241205232507-1" author="omg">
<modifyDataType tableName="variable" columnName="input_mode" newDataType="varchar(255)" />
</changeSet>
<changeSet id="20241205232507-2" author="omg">
<modifyDataType tableName="variable" columnName="variable_index" newDataType="integer" />
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity OutputData.
Add column Owner
-->
<changeSet id="20241206212207-1" author="omg">
<addColumn tableName="output_data">
<column name="owner_id" type="bigint">
<constraints nullable="false" />
</column>
</addColumn>
</changeSet>
<changeSet id="20241206212207-2" author="omg">
<addForeignKeyConstraint baseColumnNames="owner_id"
baseTableName="output_data"
constraintName="fk_output_data__owner_id"
referencedColumnNames="id"
referencedTableName="organization"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity InputData.
Change column data_comments
-->
<changeSet id="20250119123000-1" author="omg">
<modifyDataType tableName="input_data" columnName="data_comments" newDataType="TEXT"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity InputDataUploadLog.
Change column log_message
-->
<changeSet id="20250119193000-1" author="omg">
<modifyDataType tableName="input_data_upload_log" columnName="log_message" newDataType="TEXT"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity UnitConverter.
Change column convertion_formula
-->
<changeSet id="20250119194000-1" author="omg">
<modifyDataType tableName="unit_converter" columnName="convertion_formula" newDataType="TEXT"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity Variable.
Add column value_scale, to use as auto-rounding (if not null)
-->
<changeSet id="20250127183000-1" author="omg">
<addColumn tableName="variable">
<column name="value_scale" type="integer">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Atered the entity EmissionFactor.
* Data type change for column value, from decimal(21,4) to decimal(21,6)
-->
<changeSet id="20250130133000-1" author="omg">
<modifyDataType tableName="emission_factor" columnName="value" newDataType="decimal(21,6)" />
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity InputData.
Add string_value, for variables of type STRING
-->
<changeSet id="20250130152000-1" author="omg">
<addColumn tableName="input_data">
<column name="string_value" type="varchar(255)">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity InputData.
Change column decimal precision to 8, in columns source_value, variable_value, imputed_value
-->
<changeSet id="20250131120000-1" author="omg">
<modifyDataType tableName="input_data" columnName="source_value" newDataType="decimal(21,8)" />
<modifyDataType tableName="input_data" columnName="variable_value" newDataType="decimal(21,8)" />
<modifyDataType tableName="input_data" columnName="imputed_value" newDataType="decimal(21,8)" />
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Alter the entity OutputData.
Change column value decimal precision to 8
-->
<changeSet id="20250131121000-1" author="omg">
<modifyDataType tableName="output_data" columnName="value" newDataType="decimal(21,8)" />
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Atered the entity EmissionFactor.
* Data type change for column value, from decimal(21,4) to decimal(21,8)
-->
<changeSet id="20250131122000-1" author="omg">
<modifyDataType tableName="emission_factor" columnName="value" newDataType="decimal(21,8)" />
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Atered the entity EmissionFactor.
* Add column Version
-->
<changeSet id="20250209225000-1" author="omg">
<addColumn tableName="emission_factor">
<column name="version" type="integer" defaultValueNumeric="-1">
<constraints nullable="false" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity DashboardComponent.
-->
<changeSet id="20250211161000-1" author="omg">
<createTable tableName="dashboard_component" remarks="Dashboard Component\nDefines a name for a group of outputs, that will represent a output component to show in the dashboard.">
<column name="id" type="bigint" autoIncrement="true" startWith="1">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="User defined code. Must be unique.">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_dashboard_component__code" />
</column>
<column name="name" type="varchar(255)" remarks="The name of the DashboardComponent entry. Allows duplicate name&apos;s, but NOT duplicate code&apos;s.">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)" remarks="A more elaborate description of the DashboardComponent..">
<constraints nullable="true" />
</column>
<column name="is_active" type="boolean">
<constraints nullable="true" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
</createTable>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity DashboardComponentDetail.
-->
<changeSet id="20250211161001-1" author="jhipster">
<createTable tableName="dashboard_component_detail" remarks="DashboardComponentDetail">
<column name="id" type="bigint" autoIncrement="true" startWith="1">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="variable_id" type="bigint" remarks="Intended only for Variables of output type">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
</createTable>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity DashboardComponentDetail.
#1 Add relation column to parent dashboard_component_id
-->
<changeSet id="20250215093000-1" author="jhipster">
<!-- Step 1: Add the column to the existing table -->
<addColumn tableName="dashboard_component_detail">
<column name="dashboard_component_id" type="bigint">
<constraints nullable="false" />
</column>
</addColumn>
<!-- Step 2: Add foreign key constraint to link it with the referenced table -->
<addForeignKeyConstraint
baseTableName="dashboard_component_detail"
baseColumnNames="dashboard_component_id"
referencedTableName="dashboard_component"
referencedColumnNames="id"
constraintName="fk_dashboard_component_detail__dashboard_component_id"/>
</changeSet>
<!--
Altered the entity DashboardComponentDetail.
#2 Change column variable_id to a relation FK
-->
<changeSet id="20250215093000-2" author="jhipster">
<!-- Step 1: Add the column to the existing table -->
<modifyDataType tableName="dashboard_component_detail" columnName="variable_id" newDataType="bigint" />
<!-- Step 2: Add foreign key constraint to link it with the referenced table -->
<addForeignKeyConstraint
baseTableName="dashboard_component_detail"
baseColumnNames="variable_id"
referencedTableName="variable"
referencedColumnNames="id"
constraintName="fk_dashboard_component_detail__variable_id"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity DashboardComponentDetail.
#1 Add sort column
-->
<changeSet id="20250228164500-1" author="omg">
<!-- Step 1: Add column -->
<addColumn tableName="dashboard_component_detail">
<column name="idx_order" type="int" />
</addColumn>
</changeSet>
<!-- Step 2: Populate column with sequential numbers -->
<changeSet id="20250228164500-2" author="omg">
<sql>
SET @row_number = 0;
UPDATE dashboard_component_detail
JOIN (SELECT id FROM dashboard_component_detail ORDER BY id) sorted
ON dashboard_component_detail.id = sorted.id
SET dashboard_component_detail.idx_order = (@row_number := @row_number + 1);
</sql>
</changeSet>
<!-- Step 3: Make the column non-nullable -->
<changeSet id="20250228164500-3" author="omg">
<addNotNullConstraint tableName="dashboard_component_detail" columnName="idx_order" columnDataType="int"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity DashboardComponent.
#1 Add type and chart_type enums
-->
<changeSet id="20250303485000-1" author="omg">
<!-- Step 1: Add column's -->
<addColumn tableName="dashboard_component">
<column name="type" type="varchar(15)" />
<column name="chart_type" type="varchar(15)" />
</addColumn>
</changeSet>
<!-- Step 2: Populate type column with default 'TABLE' -->
<changeSet id="20250303485000-2" author="omg">
<sql>
UPDATE dashboard_component
SET dashboard_component.type = 'TABLE';
</sql>
</changeSet>
<!-- Step 3: Make the column non-nullable -->
<changeSet id="20250303485000-3" author="omg">
<addNotNullConstraint tableName="dashboard_component" columnName="type" columnDataType="varchar(15)"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity DashboardComponentDetail.
#1 Add color column
-->
<changeSet id="20250306190000-1" author="omg">
<!-- Step 1: Add column -->
<addColumn tableName="dashboard_component_detail">
<column name="color" type="varchar(15)" />
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity DashboardComponent.
#1 Add relation column to another DashboardComponent
-->
<changeSet id="20250318010000-1" author="omg">
<!-- Step 1: Add column -->
<addColumn tableName="dashboard_component">
<column name="target_dashboard_component_id" type="bigint">
<constraints nullable="true" />
</column>
</addColumn>
<!-- Step 2: Add FK -->
<addForeignKeyConstraint baseColumnNames="target_dashboard_component_id"
baseTableName="dashboard_component"
constraintName="fk_dashboard_component__target_dashboard_component_id"
referencedColumnNames="id"
referencedTableName="dashboard_component"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity DashboardComponentl.
#1 Add relation column to a detail DashboardComponent (drill-drown)
-->
<changeSet id="20250318024500-1" author="omg">
<!-- Step 1: Add column -->
<addColumn tableName="dashboard_component_detail">
<column name="target_dashboard_component_id" type="bigint">
<constraints nullable="true" />
</column>
</addColumn>
<!-- Step 2: Add FK -->
<addForeignKeyConstraint baseColumnNames="target_dashboard_component_id"
baseTableName="dashboard_component_detail"
constraintName="fk_dashboard_component_detail__target_dashboard_component_id"
referencedColumnNames="id"
referencedTableName="dashboard_component"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity DashboardComponent.
#1 Drop targetDashboardComponent
-->
<changeSet id="20250318024600-1" author="omg">
<!-- Step 1: Drop FK -->
<dropForeignKeyConstraint
baseTableName="dashboard_component"
constraintName="fk_dashboard_component__target_dashboard_component_id"/>
<!-- Step 1: Drop column -->
<dropColumn
tableName="dashboard_component"
columnName="target_dashboard_component_id"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity VariableCategory.
#1 Add hidden_for_data
-->
<changeSet id="20250321121200-1" author="omg">
<addColumn tableName="variable_category">
<column name="hidden_for_data" type="boolean">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity VariableScope.
#1 Add: hidden_for_data & hidden_for_factor
-->
<changeSet id="20250325000000-1" author="omg">
<addColumn tableName="variable_scope">
<column name="hidden_for_data" type="boolean">
<constraints nullable="true" />
</column>
</addColumn>
<addColumn tableName="variable_scope">
<column name="hidden_for_factor" type="boolean">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity VariableCategory.
#1 Add hidden_for_factor
-->
<changeSet id="20250325000001-1" author="omg">
<addColumn tableName="variable_category">
<column name="hidden_for_factor" type="boolean">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity DashboardComponentDetail.
#1 Add column for a help text
-->
<changeSet id="20250328201500-1" author="omg">
<!-- Step 1: Add column -->
<addColumn tableName="dashboard_component_detail">
<column name="help" type="TEXT">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity Organization.
#1 Add column for sorting, within the same level. In other words, sorter for children of same parent.
-->
<changeSet id="20250331130000-1" author="omg">
<!-- Step 1: Add column -->
<addColumn tableName="organization">
<column name="sort" type="integer">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity Variable.
#1 Add: hidden_for_main. This will hide the variable in InputData for the top organization
-->
<changeSet id="20250331220000-1" author="omg">
<addColumn tableName="variable">
<column name="hidden_for_main" type="boolean">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity DashboardComponent.
#1 add dashboard_view enumeration column
-->
<changeSet id="20250402144500-1" author="omg">
<addColumn tableName="dashboard_component">
<column name="dashboard_view" type="varchar(15)" />
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity SecurityResource.
-->
<changeSet id="20250402200000-1" author="omg">
<createTable tableName="security_resource" remarks="Security Resource\nTable with app resources that can be subject to security permission configuration.">
<column name="id" type="bigint" autoIncrement="true" startWith="1">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="User defined code. Must be unique.">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_security_resource__code" />
</column>
<column name="name" type="varchar(255)" remarks="The name of the SecurityResource. User friendly name.">
<constraints nullable="false" />
</column>
<column name="type" type="varchar(15)" remarks="A type to identify this resource. (see enum SecurityResourceType)">
<constraints nullable="false" />
</column>
<column name="default_create_permission" type="varchar(15)" remarks="A default permission for the resource in the scope : create.">
<constraints nullable="false" />
</column>
<column name="default_read_permission" type="varchar(15)" remarks="A default permission for the resource in the scope : read.">
<constraints nullable="false" />
</column>
<column name="default_update_permission" type="varchar(15)" remarks="A default permission for the resource in the scope : update.">
<constraints nullable="false" />
</column>
<column name="default_delete_permission" type="varchar(15)" remarks="A default permission for the resource in the scope : delete.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
</createTable>
</changeSet>
<!--
Added the entity SecurityGroup.
-->
<changeSet id="20250402200000-2" author="omg">
<createTable tableName="security_group" remarks="Security Group\nA group of permissions.">
<column name="id" type="bigint" autoIncrement="true" startWith="1">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="varchar(255)" remarks="User defined code. Must be unique.">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_security_group__code" />
</column>
<column name="name" type="varchar(255)" remarks="The name of the SecurityGroup. User friendly name.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
</createTable>
</changeSet>
<!--
Added the entity SecurityGroupPermission.
-->
<changeSet id="20250402200000-3" author="omg">
<createTable tableName="security_group_permission" remarks="Security Group Permission\nThe list of permissions for the group.">
<column name="id" type="bigint" autoIncrement="true" startWith="1">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="security_group_id" type="bigint">
<constraints nullable="false" />
</column>
<column name="security_resource_id" type="bigint">
<constraints nullable="false" />
</column>
<column name="create_permission" type="varchar(15)" remarks="Permission for the resource in the scope : create.">
<constraints nullable="false" />
</column>
<column name="read_permission" type="varchar(15)" remarks="Permission for the resource in the scope : read.">
<constraints nullable="false" />
</column>
<column name="update_permission" type="varchar(15)" remarks="Permission for the resource in the scope : update.">
<constraints nullable="false" />
</column>
<column name="delete_permission" type="varchar(15)" remarks="Permission for the resource in the scope : delete.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
</createTable>
<addForeignKeyConstraint
baseTableName="security_group_permission"
baseColumnNames="security_group_id"
referencedTableName="security_group"
referencedColumnNames="id"
constraintName="fk_security_group_permission__security_group_id"/>
<addForeignKeyConstraint
baseTableName="security_group_permission"
baseColumnNames="security_resource_id"
referencedTableName="security_resource"
referencedColumnNames="id"
constraintName="fk_security_group_permission__security_resource_id"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Add unique index to SecurityResource.
-->
<changeSet id="20250409110000-1" author="omg">
<createIndex indexName="idx_security_resource_unique"
tableName="security_resource"
unique="true">
<column name="code"/>
</createIndex>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Add single output unique variable flag, and target_owner.
-->
<changeSet id="20250412010000-1" author="omg">
<addColumn tableName="variable">
<column name="output_single" type="boolean">
<constraints nullable="true" />
</column>
</addColumn>
<addColumn tableName="variable">
<column name="output_owner_id" type="bigint">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
<changeSet id="20250412010000-2" author="omg">
<addForeignKeyConstraint baseColumnNames="output_owner_id"
baseTableName="variable"
constraintName="fk_variable__owner_id"
referencedColumnNames="id"
referencedTableName="organization"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<property name="blobType" value="LONGBLOB"/>
<!--
Added the entity Document.
-->
<changeSet id="20250414100000-1" author="jhipster">
<createTable tableName="document" remarks="Support documents (attach's) to download by the user.">
<column name="id" type="bigint" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="title" type="varchar(255)" remarks="A simple and small text with a title, for human reference and better relation">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)" remarks="An optional additional description">
<constraints nullable="true" />
</column>
<column name="data_file" type="${blobType}" remarks="The uploaded file, usually a PDF.">
<constraints nullable="false" />
</column>
<column name="data_file_content_type" type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
</createTable>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity DashboardComponent.
#1 Add is_exportable
-->
<changeSet id="20251504084000-1" author="omg">
<addColumn tableName="dashboard_component">
<column name="is_exportable" type="boolean" defaultValueBoolean="false">
<constraints nullable="false" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity jhi_user.
-->
<changeSet id="20250415163500-1" author="omg">
<addColumn tableName="jhi_user">
<column name="security_group_id" type="bigint">
<constraints nullable="true" />
</column>
</addColumn>
<addForeignKeyConstraint
baseTableName="jhi_user"
baseColumnNames="security_group_id"
referencedTableName="security_group"
referencedColumnNames="id"
constraintName="fk_jhi_user__security_group_id"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Update the entity Variable.outputSingle
The column CAN'T be null, set to FALSE
-->
<changeSet id="20250415200000-1" author="omg">
<update tableName="variable">
<column name="output_single" valueBoolean="false"/>
<where>output_single IS NULL</where>
</update>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity ContentPage.
-->
<changeSet id="20250416090000-1" author="omg">
<createTable tableName="content_page" remarks="Content Page stores HTML pages.">
<column name="id" type="bigint" autoIncrement="true" startWith="1">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="slug" type="varchar(50)">
<constraints nullable="false" unique="true"/>
</column>
<column name="title" type="varchar(512)">
<constraints nullable="false"/>
</column>
<column name="html_content" type="longtext">
<constraints nullable="false"/>
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
</createTable>
</changeSet>
<changeSet id="20250416090000-2" author="omg">
<insert tableName="content_page">
<column name="title" value="Home Page Anónimo"/>
<column name="slug" value="HOME_ANONYMOUS"/>
<column name="html_content" value="&lt;h1&gt;Home Page Anónimo&lt;/h1&gt;"/>
<column name="version" value="0"/>
</insert>
<insert tableName="content_page">
<column name="title" value="Home Page Autenticado"/>
<column name="slug" value="HOME_AUTHENTICATED"/>
<column name="html_content" value="&lt;h1&gt;Home Page Autenticado&lt;/h1&gt;"/>
<column name="version" value="0"/>
</insert>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity Variable.
Change formula column type
-->
<changeSet id="20250416120000-1" author="omg">
<modifyDataType tableName="variable" columnName="output_formula" newDataType="TEXT"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Added the entity DashboardComponentOrganization.
-->
<changeSet id="20250502222301-1" author="omg">
<createTable tableName="dashboard_component_org" remarks="DashboardComponentOrganization">
<column name="id" type="bigint" autoIncrement="true" startWith="1">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="dashboard_component_id" type="bigint" remarks="Parent DashboardComponent">
<constraints nullable="false" />
</column>
<column name="organization_id" type="bigint" remarks="Relation with Organization">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
</createTable>
</changeSet>
<changeSet id="20250502222301-2" author="omg">
<addForeignKeyConstraint baseColumnNames="dashboard_component_id"
baseTableName="dashboard_component_org"
constraintName="fk_dashboard_component_org__dashboard_component_id"
referencedColumnNames="id"
referencedTableName="dashboard_component"
/>
<addForeignKeyConstraint baseColumnNames="organization_id"
baseTableName="dashboard_component_org"
constraintName="fk_dashboard_component_org__organization_id"
referencedColumnNames="id"
referencedTableName="organization"
/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<!--
Altered the entity Resilientlog.
- Change column log_message to TEXT, to hold all error message
-->
<changeSet id="20250506120000-1" author="omg">
<modifyDataType tableName="resilient_log" columnName="log_message" newDataType="TEXT"/>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<property name="datetimeType" value="DATETIME"/>
<!--
Added the entity ResilientLog.
-->
<changeSet id="20252104104000-1" author="omg">
<createTable tableName="resilient_log" remarks="Resilient Log message tabel\nThis is a generic log table, for multiple processes to save event messages (Info; Warn; Error) that occours. This allows for asynchronous message reading.">
<column name="id" type="bigint" autoIncrement="true" startWith="1">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="owner_id" type="bigint">
<constraints nullable="false" />
</column>
<column name="level" type="varchar(15)" remarks="The level of the log. INFO; WARN; ERROR">
<constraints nullable="false" />
</column>
<column name="log_message" type="varchar(255)" remarks="The log of the event.">
<constraints nullable="false" />
</column>
<column name="creation_date" type="${datetimeType}" remarks="The creation date (insert). When the data was inserted into the system.">
<constraints nullable="false" />
</column>
<column name="creation_username" type="varchar(255)" remarks="The actual username logged into the system, that inserted the data. NOT a reference to the user, but the login username.">
<constraints nullable="false" />
</column>
<column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
<constraints nullable="false" />
</column>
</createTable>
<dropDefaultValue tableName="resilient_log" columnName="creation_date" columnDataType="${datetimeType}"/>
</changeSet>
<changeSet id="20252104104000-2" author="omg">
<createIndex
indexName="idx_resilient_log__owner_id"
tableName="resilient_log"
unique="false">
<column name="owner_id"/>
</createIndex>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,3 @@
name
ROLE_ADMIN
ROLE_USER
1 name
2 ROLE_ADMIN
3 ROLE_USER

View file

@ -0,0 +1,3 @@
id;login;password_hash;first_name;last_name;email;image_url;activated;lang_key;created_by;last_modified_by
1;admin;$2a$10$gSAhZrxMllrbgj/kkK9UceBPpChGWJA7SYIb1Mqo.n5aNLq1/oRrC;Administrator;Administrator;admin@localhost;;true;pt-pt;system;system
2;user;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;User;User;user@localhost;;true;pt-pt;system;system
1 id login password_hash first_name last_name email image_url activated lang_key created_by last_modified_by
2 1 admin $2a$10$gSAhZrxMllrbgj/kkK9UceBPpChGWJA7SYIb1Mqo.n5aNLq1/oRrC Administrator Administrator admin@localhost true pt-pt system system
3 2 user $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K User User user@localhost true pt-pt system system

View file

@ -0,0 +1,4 @@
user_id;authority_name
1;ROLE_ADMIN
1;ROLE_USER
2;ROLE_USER
1 user_id authority_name
2 1 ROLE_ADMIN
3 1 ROLE_USER
4 2 ROLE_USER

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View file

@ -0,0 +1,11 @@
id;source_value;variable_value;imputed_value;source_type;data_date;change_date;change_username;data_source;data_user;data_comments;creation_date;creation_username;version
1;31790.86;5076.76;14182.61;AUTO;2024-10-14;2024-10-14T13:19:22;into hence;hm valiantly furiously;high-level;huzzah;2024-10-14T16:43:41;yum yet yahoo;497
2;6639.1;11244.91;31245.28;MANUAL;2024-10-14;2024-10-14T14:10:37;mechanically since criteria;once curiously;joyously;deeply personal;2024-10-14T20:01:48;weight;19697
3;14476.27;4988.12;22552.23;MANUAL;2024-10-14;2024-10-14T12:39:10;beneath frightened optimistically;wide brilliant;dreamily wherever;brand;2024-10-15T05:08:19;recant or aside;6233
4;21517.23;22462.31;24020.75;AUTO;2024-10-15;2024-10-15T04:24:07;now;meanwhile;though hungrily;scented hmph;2024-10-14T11:15:31;angrily gee even;15803
5;26396.47;13827.3;9348.26;MANUAL;2024-10-15;2024-10-14T23:57:26;armpit why;owlishly;shyly hmph uncork;lacquer;2024-10-14T21:13:26;faithful on;6337
6;5149.3;3037.95;16620.4;MANUAL;2024-10-14;2024-10-14T16:47:39;whether;horror joyously;on shingle;loaf as distorted;2024-10-15T05:14:00;police almost;12166
7;25871.71;19279.41;3338.88;FILE;2024-10-14;2024-10-14T22:46:01;blindfolded;push charset;jam-packed knottily next;idle enchanted titanium;2024-10-15T08:24:10;coliseum loathsome and;13182
8;30611.47;31504.17;24575.53;AUTO;2024-10-14;2024-10-14T20:25:09;geez unlike;towards meanwhile system;thankfully meaty;quarrelsomely;2024-10-14T23:57:40;meaningfully fatherly;25380
9;21035.94;1658.63;8435.49;MANUAL;2024-10-15;2024-10-14T13:52:50;beyond acidly;vastly complete;despite once;for the concerning;2024-10-15T03:04:02;whenever why;13909
10;30685.28;18869.47;30593.5;DISTRIB;2024-10-15;2024-10-15T03:30:08;proctor tight waiting;ew by;tepid defiantly knowing;aboard blindside tender;2024-10-15T06:55:57;industrialize while oh;8510
1 id source_value variable_value imputed_value source_type data_date change_date change_username data_source data_user data_comments creation_date creation_username version
2 1 31790.86 5076.76 14182.61 AUTO 2024-10-14 2024-10-14T13:19:22 into hence hm valiantly furiously high-level huzzah 2024-10-14T16:43:41 yum yet yahoo 497
3 2 6639.1 11244.91 31245.28 MANUAL 2024-10-14 2024-10-14T14:10:37 mechanically since criteria once curiously joyously deeply personal 2024-10-14T20:01:48 weight 19697
4 3 14476.27 4988.12 22552.23 MANUAL 2024-10-14 2024-10-14T12:39:10 beneath frightened optimistically wide brilliant dreamily wherever brand 2024-10-15T05:08:19 recant or aside 6233
5 4 21517.23 22462.31 24020.75 AUTO 2024-10-15 2024-10-15T04:24:07 now meanwhile though hungrily scented hmph 2024-10-14T11:15:31 angrily gee even 15803
6 5 26396.47 13827.3 9348.26 MANUAL 2024-10-15 2024-10-14T23:57:26 armpit why owlishly shyly hmph uncork lacquer 2024-10-14T21:13:26 faithful on 6337
7 6 5149.3 3037.95 16620.4 MANUAL 2024-10-14 2024-10-14T16:47:39 whether horror joyously on shingle loaf as distorted 2024-10-15T05:14:00 police almost 12166
8 7 25871.71 19279.41 3338.88 FILE 2024-10-14 2024-10-14T22:46:01 blindfolded push charset jam-packed knottily next idle enchanted titanium 2024-10-15T08:24:10 coliseum loathsome and 13182
9 8 30611.47 31504.17 24575.53 AUTO 2024-10-14 2024-10-14T20:25:09 geez unlike towards meanwhile system thankfully meaty quarrelsomely 2024-10-14T23:57:40 meaningfully fatherly 25380
10 9 21035.94 1658.63 8435.49 MANUAL 2024-10-15 2024-10-14T13:52:50 beyond acidly vastly complete despite once for the concerning 2024-10-15T03:04:02 whenever why 13909
11 10 30685.28 18869.47 30593.5 DISTRIB 2024-10-15 2024-10-15T03:30:08 proctor tight waiting ew by tepid defiantly knowing aboard blindside tender 2024-10-15T06:55:57 industrialize while oh 8510

View file

@ -0,0 +1,11 @@
id;title;data_file;data_file_content_type;upload_file_name;disk_file_name;type;state;comments;creation_date;creation_username;version
1;phooey;../fake-data/blob/hipster.png;image/png;although wingtip;bah physical;INVENTORY;PROCESSING;round delicious;2024-10-14T12:55:47;er pfft furthermore;26953
2;balalaika clueless;../fake-data/blob/hipster.png;image/png;repeal;or kosher constraint;INVENTORY;UPLOADED;whoa;2024-10-14T18:07:51;gravitate what;18379
3;lining;../fake-data/blob/hipster.png;image/png;ha gel closely;rightfully;INVENTORY;ERROR;warped indeed orange;2024-10-15T02:47:15;and insect;17176
4;hmph;../fake-data/blob/hipster.png;image/png;sentiment;expertise;INVENTORY;PROCESSING;nor triangular;2024-10-15T07:30:44;remix;31925
5;acidly unless like;../fake-data/blob/hipster.png;image/png;yuck;and homeland;INVENTORY;UPLOADED;reassuringly sweetly;2024-10-15T07:42:22;violent;2562
6;guilty healthy;../fake-data/blob/hipster.png;image/png;jovially beyond;capital instantly;INVENTORY;UPLOADED;ew;2024-10-14T09:53:29;praise affect;14492
7;severe victoriously;../fake-data/blob/hipster.png;image/png;weakly helo sadly;lest quirky vaccinate;ACCOUNTING;UPLOADED;for dreamily;2024-10-14T18:46:05;tummy anonymize;16
8;united burden;../fake-data/blob/hipster.png;image/png;psst yet vice;kowtow;ACCOUNTING;PROCESSED;hesitate and;2024-10-15T00:04:37;really executive briskly;18139
9;acrobatic around fluffy;../fake-data/blob/hipster.png;image/png;pfft than;though;INVENTORY;ERROR;audit well-informed slowly;2024-10-14T12:47:35;true;23531
10;unlike to;../fake-data/blob/hipster.png;image/png;log jealously;partially meanwhile;ACCOUNTING;UPLOADED;off;2024-10-15T08:32:33;upon apostrophize cuss;23458
1 id title data_file data_file_content_type upload_file_name disk_file_name type state comments creation_date creation_username version
2 1 phooey ../fake-data/blob/hipster.png image/png although wingtip bah physical INVENTORY PROCESSING round delicious 2024-10-14T12:55:47 er pfft furthermore 26953
3 2 balalaika clueless ../fake-data/blob/hipster.png image/png repeal or kosher constraint INVENTORY UPLOADED whoa 2024-10-14T18:07:51 gravitate what 18379
4 3 lining ../fake-data/blob/hipster.png image/png ha gel closely rightfully INVENTORY ERROR warped indeed orange 2024-10-15T02:47:15 and insect 17176
5 4 hmph ../fake-data/blob/hipster.png image/png sentiment expertise INVENTORY PROCESSING nor triangular 2024-10-15T07:30:44 remix 31925
6 5 acidly unless like ../fake-data/blob/hipster.png image/png yuck and homeland INVENTORY UPLOADED reassuringly sweetly 2024-10-15T07:42:22 violent 2562
7 6 guilty healthy ../fake-data/blob/hipster.png image/png jovially beyond capital instantly INVENTORY UPLOADED ew 2024-10-14T09:53:29 praise affect 14492
8 7 severe victoriously ../fake-data/blob/hipster.png image/png weakly helo sadly lest quirky vaccinate ACCOUNTING UPLOADED for dreamily 2024-10-14T18:46:05 tummy anonymize 16
9 8 united burden ../fake-data/blob/hipster.png image/png psst yet vice kowtow ACCOUNTING PROCESSED hesitate and 2024-10-15T00:04:37 really executive briskly 18139
10 9 acrobatic around fluffy ../fake-data/blob/hipster.png image/png pfft than though INVENTORY ERROR audit well-informed slowly 2024-10-14T12:47:35 true 23531
11 10 unlike to ../fake-data/blob/hipster.png image/png log jealously partially meanwhile ACCOUNTING UPLOADED off 2024-10-15T08:32:33 upon apostrophize cuss 23458

Some files were not shown because too many files have changed in this diff Show more