Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.69 KB | None | 0 0
  1. User:
  2.   actAs: { Timestampable: ~ }
  3.   columns:
  4.     name:         { type: string(64), notnull: true }
  5.     email:        { type: string(64), notnull: true }
  6.     sex:          { type: string(16), notnull: false }
  7.  
  8. Login:
  9.   actAs: { Timestampable: ~ }
  10.   columns:
  11.     username:         { type: string(255), notnull: true }
  12.     password:         { type: string(255), notnull: true }
  13.     user_id:          { type: integer, notnull: true }
  14.   relations:
  15.     User: { class: User, onDelete: CASCADE, local: user_id, foreign: id, foreignAlias: Login }
  16.  
  17. Submission:
  18.   actAs: { Timestampable: ~ }
  19.   columns:
  20.     user_id:              { type: integer, notnull: true }
  21.     comment:              { type: string(16000), notnull: false }
  22.     accept_agreement:     { type: boolean, notnull: true }
  23.     questionnaire_id:     { type: integer, notnull: true }
  24.     first_question_id:    { type: integer, notnull: false }
  25.     current_question_id:  { type: integer, notnull: false }
  26.   relations:
  27.     User: { class: User, onDelete: CASCADE, local: user_id, foreign: id, foreignAlias: Submissions }
  28.     Questionnaire: { class: Questionnaire, onDelete: CASCADE, local: questionnaire_id, foreign: id, foreignAlias: Submissions }
  29.     FirstQuestion: { class: QuestionOrder, onDelete: CASCADE, local: first_question_id, foreign: id, foreignAlias: X0 }
  30.     CurrentQuestion: { class: QuestionOrder, onDelete: CASCADE, local: current_question_id, foreign: id, foreignAlias: X1 }
  31.  
  32. Questionnaire:
  33.   actAs: { Timestampable: ~ }
  34.   columns:
  35.     name:         { type: string(64), notnull: true }
  36.     text:         { type: string(16000), notnull: true }
  37.  
  38. Question:
  39.   actAs: { Timestampable: ~ }
  40.   columns:
  41.     text:                 { type: string(16000), notnull: true }
  42.     type:                 { type: string(16), notnull: true }
  43.     questionnaire_id:      { type: integer, notnull: true }
  44.   relations:
  45.     Questionnaire: { class: Questionnaire, onDelete: CASCADE, local: questionnaire_id, foreign: id, foreignAlias: Questions }
  46.  
  47. QuestionOption:
  48.   actAs: { Timestampable: ~ }
  49.   columns:
  50.     text:                 { type: string(255), notnull: true }
  51.     question_id:          { type: integer, notnull: true }
  52.   relations:
  53.     Question: { class: Question, onDelete: CASCADE, local: question_id, foreign: id, foreignAlias: Options }
  54.  
  55. QuestionAnswer:
  56.   actAs: { Timestampable: ~ }
  57.   columns:
  58.     text:                 { type: string(255), notnull: false }
  59.     question_id:          { type: integer, notnull: true }
  60.     submission_id:        { type: integer, notnull: true }
  61.     option_id:            { type: integer, notnull: false }
  62.   relations:
  63.     Submission: { class: Submission, onDelete: CASCADE, local: submission_id, foreign: id, foreignAlias: Answers}
  64.     Question: { class: Question, onDelete: CASCADE, local: question_id, foreign: id, foreignAlias: Answers}
  65.     Option: { class: QuestionOption, onDelete: CASCADE, local: option_id, foreign: id, foreignAlias: Ansers}
  66.  
  67. QuestionOrder:
  68.   actAs: { Timestampable: ~ }
  69.   columns:
  70.     previous_question_id: { type: integer, notnull: false }
  71.     next_question_id:     { type: integer, notnull: false }
  72.     question_id:          { type: integer, notnull: true }
  73.     answer_id:            { type: integer, notnull: false }
  74.   relations:
  75.     PerviousQuestion: { class: QuestionOrder, onDelete: CASCADE, local: previous_question_id, foreign: id, foreignAlias: X4 }
  76.     NextQuestion: {class: QuestionOrder, onDelete: CASCADE, local: next_question_id, foreign: id, foreignAlias: X5 }
  77.     Question: { class: Question, onDelete: CASCADE, local: question_id, foreign: id, foreignAlias: Orders}
  78.     Answer: { class: QuestionAnswer, onDelete: CASCADE, local: answer_id, foreign: id, foreignAlias: Order}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement