Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.07 KB | None | 0 0
  1. CREATE TABLE protocols{
  2.     id                  uuid            NOT NULL,
  3.     code                VARCHAR(255),
  4.     notes               VARCHAR(255),
  5.     created_at          datetime,
  6.     updated_at          datetime,
  7.     fixation_target     uuid,
  8.     is_active           BOOLEAN         DEFAULT TRUE,
  9.     is_default          BOOLEAN         DEFAULT FALSE,
  10.     PRIMARY KEY (id),
  11.     FOREIGN KEY (fixation_target) REFERENCES fixation_targets(id)
  12. };
  13.  
  14. CREATE TABLE protocols_execution{
  15.     id                          uuid            NOT NULL,
  16.     exam_id                     uuid            NOT NULL,
  17.     serialized_protocol_data    VARCHAR(10000)  NOT NULL,
  18.     PRIMARY KEY (id),
  19.     FOREIGN KEY (exam_id) REFERENCES exams(id),
  20. };
  21.  
  22. CREATE TABLE protocol_steps{
  23.     id                  uuid            NOT NULL,
  24.     protocol_id         uuid            NOT NULL,
  25.     step_position       INT             NOT NULL,
  26.     notes               VARCHAR(255),
  27.     image_tipe          VARCHAR(255)    NOT NULL,
  28.     number_of_frames    INT             NOT NULL,
  29.     focus_shift         INT             DEFAULT 0,
  30.     PRIMARY KEY (id)
  31.     FOREIGN KEY (protocol_id) REFERENCES protocols(id),
  32. };
  33.  
  34. CREATE TABLE protocol_data{
  35.     id                      uuid            NOT NULL,
  36.     image_id                uuid            NOT NULL,
  37.     serialized_step_data    text            NOT NULL,          
  38.     PRIMARY KEY (id),
  39.     FOREIGN KEY (image_id) REFERENCES images(id)
  40. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement