qr-access-api/src/main/resources/db/changelog/1.0.0/changelog.yml
2025-02-19 17:08:51 +03:00

316 lines
11 KiB
YAML

databaseChangeLog:
- changeSet:
id: create-oauth2-registered-clients
author: d.krupin
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:
tableName: oauth2_registered_client
columns:
- column:
constraints:
nullable: false
primaryKey: true
primaryKeyName: PK_oauth2_client
name: id
type: VARCHAR(100)
- column:
constraints:
nullable: false
unique: true
name: client_id
type: VARCHAR(100)
- column:
name: client_id_issued_at
type: TIMESTAMP
constraints:
nullable: false
- column:
name: client_secret
type: TEXT
constraints:
nullable: false
- column:
name: client_secret_expires_at
type: TIMESTAMP
constraints:
nullable: false
- column:
name: client_name
type: TEXT
constraints:
nullable: false
- column:
name: client_authentication_methods
type: TEXT
constraints:
nullable: false
- column:
name: authorization_grant_types
type: TEXT
constraints:
nullable: true
- column:
name: redirect_uris
type: TEXT
constraints:
nullable: true
- column:
name: post_logout_redirect_uris
type: TEXT
constraints:
nullable: false
- column:
name: scopes
type: TEXT
constraints:
nullable: false
- column:
name: client_settings
type: TEXT
constraints:
nullable: false
- column:
name: token_settings
type: TEXT
constraints:
nullable: false
- column:
name: admin_editable
type: BOOLEAN
defaultValue: TRUE
constraints:
nullable: false
- column:
name: partner_id
type: TEXT
constraints:
nullable: true
foreignKeyName: FK_units_partners
references: partners(id)
- createTable:
tableName: doors
columns:
- column:
constraints:
nullable: false
primaryKey: true
primaryKeyName: PK_doors
name: id
type: TEXT
- column:
constraints:
nullable: false
name: unit_id
type: VARCHAR(100)
- column:
constraints:
nullable: true
name: description
type: TEXT
- column:
name: count
type: INT
constraints:
nullable: false
- column:
name: parent_door_ids
type: TEXT
constraints:
nullable: true
- createTable:
tableName: clients
columns:
- column:
constraints:
nullable: false
primaryKey: true
primaryKeyName: PK_clients
name: id
type: TEXT
- column:
constraints:
nullable: false
name: email
type: TEXT
- column:
constraints:
nullable: false
name: email_is_confirmed
type: BOOLEAN
- createTable:
tableName: rent
columns:
- column:
constraints:
nullable: false
primaryKey: true
primaryKeyName: PK_rent
name: id
type: TEXT
- column:
constraints:
nullable: true
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
constraints:
nullable: false
foreignKeyName: FK_rent_clients
references: clients(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:
tableName: schedule
columns:
- column:
constraints:
nullable: false
primaryKey: true
primaryKeyName: PK_schedule_doors
name: id
type: TEXT
- column:
name: door_id
type: TEXT
constraints:
nullable: false
foreignKeyName: FK_schedule_doors
references: doors(id)
- column:
constraints:
nullable: true
name: start_time
type: TIME WITH TIME ZONE
- column:
constraints:
nullable: true
name: end_time
type: TIME WITH TIME ZONE
- column:
name: date
type: DATE
constraints:
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:
tableName: oauth2_registered_client
columns:
- column:
name: id
value: f1434eb3-7c38-45c2-9e21-f1917157ffb7
- column:
name: client_id
value: admin
- column:
name: client_id_issued_at
valueComputed: CURRENT_TIMESTAMP
- column:
name: client_secret
value: '{bcrypt}$2a$12$ihzZm/AsJCAYjoII9hd1IO25xpmHhnsOnaSuvfTPuMgt45w7cFNXi'
- column:
name: client_secret_expires_at
value: '2030-06-02T12:00:00'
- column:
name: client_name
value: admin-client
- column:
name: client_authentication_methods
value: none
- column:
name: authorization_grant_types
value: refresh_token,authorization_code
- column:
name: redirect_uris
value: 'http://localhost:8082/login/oauth2/code/own'
- column:
name: post_logout_redirect_uris
value: 'http://localhost:8082/units'
- column:
name: scopes
value: 'admin,openid'
- column:
name: client_settings
value: '{"@class":"java.util.Collections$UnmodifiableMap","settings.client.require-proof-key":true,"settings.client.require-authorization-consent":false}'
- column:
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]}'
- column:
name: admin_editable
value: 'FALSE'
- addForeignKeyConstraint:
baseColumnNames: unit_id
baseTableName: doors
constraintName: FK_unit_door
referencedColumnNames: client_id
referencedTableName: oauth2_registered_client