diff --git a/src/main/resources/db/changelog/1.0.0/changelog.yml b/src/main/resources/db/changelog/1.0.0/changelog.yml index f2cb7ac..29e039f 100644 --- a/src/main/resources/db/changelog/1.0.0/changelog.yml +++ b/src/main/resources/db/changelog/1.0.0/changelog.yml @@ -60,4 +60,57 @@ databaseChangeLog: type: TIMESTAMP constraints: nullable: false - defaultValueComputed: CURRENT_TIMESTAMP \ No newline at end of file + 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 \ No newline at end of file