Skip to content
This repository was archived by the owner on Feb 11, 2022. It is now read-only.

Commit e36ab0c

Browse files
committed
Demonstrate multi-column constraints in the extended demo
1 parent a496bc6 commit e36ab0c

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

demo-extended/src/main/assets/migrations/1_SETUP.SQL

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CREATE TABLE 'shop'
2-
(_id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, postcode TEXT);
2+
(_id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, postcode TEXT, UNIQUE (name, postcode) ON CONFLICT REPLACE);
33
INSERT INTO 'shop'
44
(name, postcode) VALUES ("TheBigBang Shop", "L300RA");
55
INSERT INTO 'shop'
@@ -8,6 +8,10 @@ INSERT INTO 'shop'
88
(name, postcode) VALUES ("Firework Corner", "BN14FT");
99
INSERT INTO 'shop'
1010
(name, postcode) VALUES ("Asda", "L319BH");
11+
INSERT INTO 'shop'
12+
(name, postcode) VALUES ("Tesco", "L319BH");
13+
INSERT INTO 'shop'
14+
(name, postcode) VALUES ("Asda", "SK85NX");
1115

1216
CREATE TABLE 'firework'
1317
(_id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -75,3 +79,15 @@ INSERT INTO 'firework'
7579
INSERT INTO 'firework'
7680
(name, color, ftype, noise, price, shop_id)
7781
VALUES ("Asda Firework 3", "Green and Brown", "Fountain", "Fizz", 100.00, 4);
82+
INSERT INTO 'firework'
83+
(name, color, ftype, noise, price, shop_id)
84+
VALUES ("Tesco Value Fireworks", "Invisible", "Imaginary", "Silent", 1.00, 5);
85+
INSERT INTO 'firework'
86+
(name, color, ftype, noise, price, shop_id)
87+
VALUES ("Asda Firework 1", "Brown", "Rocket", "Pop", 1.00, 6);
88+
INSERT INTO 'firework'
89+
(name, color, ftype, noise, price, shop_id)
90+
VALUES ("Asda Firework 2", "Green", "Rocket", "Bang", 1.00, 6);
91+
INSERT INTO 'firework'
92+
(name, color, ftype, noise, price, shop_id)
93+
VALUES ("Asda Firework 3", "Green and Brown", "Fountain", "Fizz", 100.00, 6);

0 commit comments

Comments
 (0)