Add migrations for doors and qrs

This commit is contained in:
kashiuno 2025-01-04 15:05:41 +03:00
parent 81f7e5ebde
commit 00afbd266d

View File

@ -60,4 +60,57 @@ databaseChangeLog:
type: TIMESTAMP
constraints:
nullable: false
defaultValueComputed: CURRENT_TIMESTAMP
defaultValueComputed: CURRENT_TIMESTAMP
- 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: false
name: principal_name
type: VARCHAR(200)
- createTable:
tableName: qrs
columns:
- column:
constraints:
nullable: false
primaryKey: true
primaryKeyName: PK_qrs
name: key_code
type: TEXT
- column:
constraints:
nullable: false
foreignKeyName: fk_qr_door
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
- addForeignKeyConstraint:
baseColumnNames: unit_id, principal_name
baseTableName: doors
constraintName: FK_unit_door
referencedColumnNames: client_registration_id, principal_name
referencedTableName: oauth2_authorized_client