File tree 3 files changed +38
-15
lines changed
3 files changed +38
-15
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+
3
+ <databaseChangeLog
4
+ xmlns =" http://www.liquibase.org/xml/ns/dbchangelog"
5
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
6
+ xsi : schemaLocation =" http://www.liquibase.org/xml/ns/dbchangelog
7
+ http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd" >
8
+
9
+ <changeSet id =" 1" author =" hhimanshu" >
10
+ <createTable tableName =" books"
11
+ remarks =" A table to contain all books" >
12
+ <column name =" id" type =" int" >
13
+ <constraints nullable =" false" unique =" true" primaryKey =" true" />
14
+ </column >
15
+ <column name =" name" type =" varchar(255)" >
16
+ <constraints nullable =" false" unique =" true" />
17
+ </column >
18
+ <column name =" author" type =" int" >
19
+ <constraints nullable =" false" />
20
+ </column >
21
+ </createTable >
22
+
23
+ <createTable tableName =" authors"
24
+ remarks =" A table to contain all the authors" >
25
+ <column name =" id" type =" int" >
26
+ <constraints nullable =" false" primaryKey =" true" />
27
+ </column >
28
+ <column name =" name" type =" varchar(100)" >
29
+ <constraints nullable =" false" />
30
+ </column >
31
+ </createTable >
32
+
33
+ <addForeignKeyConstraint baseTableName =" books" baseColumnNames =" author"
34
+ constraintName =" author_fk"
35
+ referencedTableName =" authors" referencedColumnNames =" id" />
36
+ </changeSet >
37
+ </databaseChangeLog >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 6
6
xsi : schemaLocation =" http://www.liquibase.org/xml/ns/dbchangelog
7
7
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd" >
8
8
9
- <include file =" changelog/01-create-books-schema.xml" relativeToChangelogFile =" true" />
9
+ <include file =" changelog/01-create-books-and-author- schema.xml" relativeToChangelogFile =" true" />
10
10
</databaseChangeLog >
You can’t perform that action at this time.
0 commit comments