Update database scheme for new conception

This commit is contained in:
kashiuno 2025-02-16 16:44:35 +03:00
parent 0e674b7a76
commit d7ac22e54e

View File

@ -3,6 +3,21 @@ databaseChangeLog:
id: create-oauth2-registered-clients id: create-oauth2-registered-clients
author: d.krupin author: d.krupin
changes: changes:
- createTable:
tableName: partners
columns:
- column:
constraints:
nullable: false
primaryKey: true
primaryKeyName: PK_partners
name: id
type: TEXT
- column:
constraints:
nullable: false
name: name
type: TEXT
- createTable: - createTable:
tableName: oauth2_registered_client tableName: oauth2_registered_client
columns: columns:
@ -80,6 +95,13 @@ databaseChangeLog:
defaultValue: TRUE defaultValue: TRUE
constraints: constraints:
nullable: false nullable: false
- column:
name: partner_id
type: TEXT
constraints:
nullable: true
foreignKeyName: FK_units_partners
references: partners(id)
- createTable: - createTable:
tableName: doors tableName: doors
columns: columns:
@ -105,48 +127,67 @@ databaseChangeLog:
type: INT type: INT
constraints: constraints:
nullable: false nullable: false
- createTable:
tableName: qrs
columns:
- column: - column:
constraints: name: parent_door_id
nullable: false
primaryKey: true
primaryKeyName: PK_qrs
name: key_code
type: TEXT type: TEXT
- column:
constraints: constraints:
nullable: false nullable: true
foreignKeyName: fk_qr_door foreignKeyName: FK_parent_doors
references: doors(id) references: doors(id)
name: door_id
type: TEXT
- column:
constraints:
nullable: true
name: start_date_time
type: TIMESTAMP WITH TIME ZONE
- column:
constraints:
nullable: true
name: end_date_time
type: TIMESTAMP WITH TIME ZONE
- createTable: - createTable:
tableName: partners tableName: rent
columns: columns:
- column: - column:
constraints: constraints:
nullable: false nullable: false
primaryKey: true primaryKey: true
primaryKeyName: PK_partners primaryKeyName: PK_rent
name: id name: id
type: TEXT type: TEXT
- column: - column:
constraints: constraints:
nullable: false nullable: true
name: name name: start_time
type: TIME WITH TIME ZONE
- column:
constraints:
nullable: true
name: end_time
type: TIME WITH TIME ZONE
- column:
name: client_id
type: TEXT type: TEXT
constraints:
nullable: false
foreignKeyName: FK_rent_clients
references: rent(id)
- column:
name: date
type: DATE
constraints:
nullable: true
- column:
name: door_id
type: TEXT
constraints:
nullable: false
foreignKeyName: FK_rent_doors
references: doors(id)
- column:
name: qr_code
type: TEXT
constraints:
nullable: false
- column:
name: payed
type: BOOLEAN
constraints:
nullable: false
- column:
name: date_created
type: TIMESTAMP WITH TIME ZONE
constraints:
nullable: false
- createTable: - createTable:
tableName: clients tableName: clients
columns: columns:
@ -162,6 +203,11 @@ databaseChangeLog:
nullable: false nullable: false
name: email name: email
type: TEXT type: TEXT
- column:
constraints:
nullable: false
name: email_is_confirmed
type: BOOLEAN
- createTable: - createTable:
tableName: schedule tableName: schedule
columns: columns:
@ -194,6 +240,31 @@ databaseChangeLog:
type: DATE type: DATE
constraints: constraints:
nullable: false nullable: false
- createTable:
tableName: email_outbox
columns:
- column:
name: id
type: TEXT
constraints:
nullable: false
primaryKey: true
primaryKeyName: PK_email_outbox
- column:
name: email
type: TEXT
constraints:
nullable: false
- column:
name: template
type: TEXT
constraints:
nullable: false
- column:
name: additional_info
type: JSONB
constraints:
nullable: true
- insert: - insert:
tableName: oauth2_registered_client tableName: oauth2_registered_client
columns: columns:
@ -217,22 +288,22 @@ databaseChangeLog:
value: admin-client value: admin-client
- column: - column:
name: client_authentication_methods name: client_authentication_methods
value: client_secret_post value: none
- column: - column:
name: authorization_grant_types name: authorization_grant_types
value: refresh_token,authorization_code value: refresh_token,authorization_code
- column: - column:
name: redirect_uris name: redirect_uris
value: 'localhost:8082/units' value: 'http://localhost:8082/units,https://oauth.pstmn.io/v1/callback'
- column: - column:
name: post_logout_redirect_uris name: post_logout_redirect_uris
value: 'localhost:8082/units' value: 'http://localhost:8082/units'
- column: - column:
name: scopes name: scopes
value: '' value: 'admin,openid'
- column: - column:
name: client_settings name: client_settings
value: '{"@class":"java.util.Collections$UnmodifiableMap","settings.client.require-proof-key":false,"settings.client.require-authorization-consent":false}' value: '{"@class":"java.util.Collections$UnmodifiableMap","settings.client.require-proof-key":true,"settings.client.require-authorization-consent":false}'
- column: - column:
name: token_settings name: token_settings
value: '{"@class":"java.util.Collections$UnmodifiableMap","settings.token.reuse-refresh-tokens":false,"settings.token.x509-certificate-bound-access-tokens":false,"settings.token.id-token-signature-algorithm":["org.springframework.security.oauth2.jose.jws.SignatureAlgorithm","RS256"],"settings.token.access-token-time-to-live":["java.time.Duration",600.000000000],"settings.token.access-token-format":{"@class":"org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat","value":"self-contained"},"settings.token.refresh-token-time-to-live":["java.time.Duration",600.000000000],"settings.token.authorization-code-time-to-live":["java.time.Duration",300.000000000],"settings.token.device-code-time-to-live":["java.time.Duration",300.000000000]}' value: '{"@class":"java.util.Collections$UnmodifiableMap","settings.token.reuse-refresh-tokens":false,"settings.token.x509-certificate-bound-access-tokens":false,"settings.token.id-token-signature-algorithm":["org.springframework.security.oauth2.jose.jws.SignatureAlgorithm","RS256"],"settings.token.access-token-time-to-live":["java.time.Duration",600.000000000],"settings.token.access-token-format":{"@class":"org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat","value":"self-contained"},"settings.token.refresh-token-time-to-live":["java.time.Duration",600.000000000],"settings.token.authorization-code-time-to-live":["java.time.Duration",300.000000000],"settings.token.device-code-time-to-live":["java.time.Duration",300.000000000]}'