Skip to content

Commit

Permalink
anton-liauchuk#14 foreign keys
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-liauchuk committed Jun 29, 2021
1 parent 914954e commit d5844f0
Showing 1 changed file with 76 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ databaseChangeLog:
type: uuid
- column:
constraints:
foreignKeyName: course_fkey
nullable: false
name: course
type: int
- column:
constraints:
foreignKeyName: student_fkey
nullable: false
name: student
type: int
Expand All @@ -40,3 +42,77 @@ databaseChangeLog:
nullable: false
name: completion_status
type: VARCHAR(14)
- changeSet:
id: 2021_06_25-2
author: antonliauchuk
preConditions:
onFail: MARK_RAN
not:
tableExists:
tableName: enroll_course
changes:
- createTable:
tableName: enroll_course
columns:
- column:
name: id
type: int
autoIncrement: true
startWith: 1
incrementBy: 1
constraints:
primaryKey: true
primaryKeyName: enroll_course_pk
- column:
constraints:
nullable: false
name: uuid
type: uuid
- changeSet:
id: 2021_06_25-3
author: antonliauchuk
preConditions:
onFail: MARK_RAN
not:
tableExists:
tableName: student
changes:
- createTable:
tableName: student
columns:
- column:
name: id
type: int
autoIncrement: true
startWith: 1
incrementBy: 1
constraints:
primaryKey: true
primaryKeyName: student_pk
- column:
constraints:
nullable: false
name: username
type: VARCHAR(100)
- changeSet:
id: 2021_06_25-4
author: antonliauchuk
changes:
- addForeignKeyConstraint:
baseColumnNames: course
baseTableName: course_enrollment
constraintName: course_fkey
referencedColumnNames: id
referencedTableName: enroll_course
validate: true
- changeSet:
id: 2021_06_25-5
author: antonliauchuk
changes:
- addForeignKeyConstraint:
baseColumnNames: student
baseTableName: course_enrollment
constraintName: student_fkey
referencedColumnNames: id
referencedTableName: student
validate: true

0 comments on commit d5844f0

Please sign in to comment.