mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-22 22:11:29 +08:00
This removes a lot of duplicated code across the two versions of update tests (one with testing of constraints vs one without) and potentially allows for further additions more easily. Also, this splits Travis testing of updates into two jobs so they can run concurrently and reduce the amount of turnaround time for PRs. Finally, added versions since 0.8.0 that were not previously being tested.
17 lines
467 B
SQL
17 lines
467 B
SQL
-- Secondary devices table to test foreign keys in "two_Partitions"
|
|
CREATE TABLE devices (
|
|
id TEXT PRIMARY KEY,
|
|
floor INTEGER
|
|
);
|
|
|
|
INSERT INTO devices(id,floor) VALUES
|
|
('dev1', 1),
|
|
('dev2', 2),
|
|
('dev3', 3);
|
|
|
|
-- Setup "two_Partitions" to use foreign key constraints
|
|
ALTER TABLE "two_Partitions" ADD COLUMN device_id_2 TEXT NOT NULL;
|
|
|
|
ALTER TABLE "two_Partitions" ADD CONSTRAINT two_Partitions_device_id_2_fkey
|
|
FOREIGN KEY (device_id_2) REFERENCES devices(id);
|