/
changelog.postgresql.sql
55 lines (50 loc) · 1.75 KB
/
changelog.postgresql.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--liquibase formatted sql
--changeset SteveZ:45555-createtablecontacts
CREATE TABLE contacts (
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
firstname VARCHAR(255),
lastname VARCHAR(255)
);
--rollback drop table contacts;
--changeset SteveZ:45555-createtableactor
CREATE TABLE actor (
"Name" char(1) NULL
);
--rollback drop table actor;
--changeset MikeO:45556-altertableactor
ALTER TABLE actor
ADD COLUMN twitter VARCHAR(15);
--rollback alter table actor drop column twitter;
--changeset AmyS:45678-createtablecolors
CREATE TABLE colors (
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
bcolor VARCHAR,
fcolor VARCHAR
);
--rollback drop table colors;
--changeset BenG:45679-insertcolors
INSERT INTO colors (bcolor, fcolor)
VALUES
('red', 'red'),
('red', 'red'),
('red', NULL),
(NULL, 'red'),
('red', 'green'),
('red', 'blue'),
('green', 'red'),
('green', 'blue'),
('green', 'green'),
('blue', 'red'),
('blue', 'green'),
('blue', 'blue');
--rollback delete from colors where bcolor = 'red' and fcolor = 'red';
--rollback delete from colors where bcolor = 'red' and fcolor IS NULL;
--rollback delete from colors where bcolor IS NULL and fcolor = 'red';
--rollback delete from colors where bcolor = 'red' and fcolor = 'green';
--rollback delete from colors where bcolor = 'red' and fcolor = 'blue';
--rollback delete from colors where bcolor = 'green' and fcolor = 'red';
--rollback delete from colors where bcolor = 'green' and fcolor = 'blue';
--rollback delete from colors where bcolor = 'green' and fcolor = 'green';
--rollback delete from colors where bcolor = 'blue' and fcolor = 'red';
--rollback delete from colors where bcolor = 'blue' and fcolor = 'green';
--rollback delete from colors where bcolor = 'blue' and fcolor = 'blue';