Add migrations for doors and qrs
This commit is contained in:
parent
81f7e5ebde
commit
00afbd266d
@ -60,4 +60,57 @@ databaseChangeLog:
|
|||||||
type: TIMESTAMP
|
type: TIMESTAMP
|
||||||
constraints:
|
constraints:
|
||||||
nullable: false
|
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
|
Loading…
Reference in New Issue
Block a user