5
5
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
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
- <changeSet id =" 01" author =" tsiupa" >
8
+ <changeSet id =" 001" author =" ivan_tsiupa" >
9
+ <sql >
10
+ CREATE TABLE IF NOT EXISTS books
11
+ (
12
+ id BIGSERIAL NOT NULL,
13
+ title TEXT NOT NULL,
14
+ pages BIGINT NOT NULL,
15
+ PRIMARY KEY (id)
16
+ );
9
17
18
+ </sql >
19
+ </changeSet >
20
+
21
+ <changeSet id =" 002" author =" ivan_tsiupa" >
22
+ <sql >
23
+ INSERT INTO books(title, pages) VALUES('Philosophers Stone', 200);
24
+ INSERT INTO books(title, pages) VALUES('Chamber of Secrets', 233);
25
+ INSERT INTO books(title, pages) VALUES('Prisoner of Azkaban', 146);
26
+ INSERT INTO books(title, pages) VALUES('Goblet of Fire', 342);
27
+ INSERT INTO books(title, pages) VALUES('Order of the Phoenix', 146);
28
+ INSERT INTO books(title, pages) VALUES('Half-Blood Prince', 342);
29
+ INSERT INTO books(title, pages) VALUES('Deathly Hallows', 342);
30
+ </sql >
31
+ </changeSet >
32
+
33
+ <changeSet id =" 003" author =" ivan_tsiupa" >
34
+ <sql >
35
+ ALTER TABLE books ADD year BIGINT DEFAULT 0 NOT NULL;
36
+ </sql >
37
+ </changeSet >
38
+
39
+ <changeSet id =" 004" author =" ivan_tsiupa" >
40
+ <sql >
41
+ UPDATE books SET year = 1997 WHERE title = 'Philosophers Stone';
42
+ UPDATE books SET year = 1998 WHERE title = 'Chamber of Secrets';
43
+ UPDATE books SET year = 1999 WHERE title = 'Prisoner of Azkaban';
44
+ UPDATE books SET year = 2000 WHERE title = 'Goblet of Fire';
45
+ UPDATE books SET year = 2003 WHERE title = 'Order of the Phoenix';
46
+ UPDATE books SET year = 2005 WHERE title = 'Half-Blood Prince';
47
+ UPDATE books SET year = 2007 WHERE title = 'Deathly Hallows';
48
+ </sql >
10
49
</changeSet >
11
50
</databaseChangeLog >
0 commit comments