0013_plot_gcs_location.up.sql (532B)
1 CREATE TABLE IF NOT EXISTS plot_gcs_location ( 2 id CHAR(36) PRIMARY KEY NOT NULL UNIQUE CHECK(length(id) = 36), 3 created_at DATETIME NOT NULL CHECK(length(created_at) = 24), 4 updated_at DATETIME NOT NULL CHECK(length(updated_at) = 24), 5 plot_id CHAR(36) NOT NULL, 6 gcs_location_id CHAR(36) NOT NULL, 7 role TEXT NOT NULL, 8 FOREIGN KEY (plot_id) REFERENCES plot(id) ON DELETE CASCADE, 9 FOREIGN KEY (gcs_location_id) REFERENCES gcs_location(id) ON DELETE CASCADE, 10 UNIQUE (plot_id, gcs_location_id, role) 11 );