Advertisement
Guest User

Untitled

a guest
Jun 7th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.58 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: true }
  22.     accept_agreement:     { type: boolean, notnull: true }
  23.     questionaire_id:      { type: integer, notnull: true }
  24.     first_question_id:    { type: integer, notnull: true }
  25.     current_question_id:  { type: integer, notnull: false }
  26.   relations:
  27.     Questionaire: { class: Questionaire, onDelete: CASCADE, local: questionaire_id, foreign: id, foreignAlias: Questionaires }
  28.     FirstQuestion: { class: QuestionOrder, onDelete: CASCADE, local: first_question_id, foreign: id, foreignAlias: X0 }
  29.     CurrentQuestion: { class: QuestionOrder, onDelete: CASCADE, local: current_question_id, foreign: id, foreignAlias: X1 }
  30.  
  31. Questionaire:
  32.   actAs: { Timestampable: ~ }
  33.   columns:
  34.     name:         { type: string(64), notnull: true }
  35.     text:         { type: string(16000), notnull: true }
  36.  
  37. Question:
  38.   actAs: { Timestampable: ~ }
  39.   columns:
  40.     text:                 { type: string(16000), notnull: true }
  41.     type:                 { type: string(16), notnull: true }
  42.     questionaire_id:      { type: integer, notnull: true }
  43.   relations:
  44.     Questionaire: { class: Questionaire, onDelete: CASCADE, local: questionaire_id, foreign: id, foreignAlias: Questions }
  45.  
  46. QuestionOption:
  47.   actAs: { Timestampable: ~ }
  48.   columns:
  49.     text:                 { type: string(255), notnull: true }
  50.     question_id:          { type: integer, notnull: true }
  51.   relations:
  52.     Question: { class: Question, onDelete: CASCADE, local: question_id, foreign: id, foreignAlias: Options }
  53.  
  54. QuestionAnswer:
  55.   actAs: { Timestampable: ~ }
  56.   columns:
  57.     text:                 { type: string(255), notnull: false }
  58.     question_id:          { type: integer, notnull: true }
  59.     submission_id:        { type: integer, notnull: true }
  60.     option_id:            { type: integer, notnull: false }
  61.   relations:
  62.     Submission: { class: Submission, onDelete: CASCADE, local: submission_id, foreign: id, foreignAlias: Answers}
  63.     Question: { class: Question, onDelete: CASCADE, local: question_id, foreign: id, foreignAlias: Answers}
  64.     Option: { class: QuestionOption, onDelete: CASCADE, local: option_id, foreign: id, foreignAlias: Ansers}
  65.  
  66. QuestionOrder:
  67.   actAs: { Timestampable: ~ }
  68.   columns:
  69.     previous_question_id: { type: integer, notnull: false }
  70.     next_question_id:     { type: integer, notnull: false }
  71.     question_id:          { type: integer, notnull: true }
  72.     answer_id:            { type: integer, notnull: false }
  73.   relations:
  74.     PerviousQuestion: { class: QuestionOrder, onDelete: CASCADE, local: previous_question_id, foreign: id, foreignAlias: X4 }
  75.     NextQuestion: {class: QuestionOrder, onDelete: CASCADE, local: next_question_id, foreign: id, foreignAlias: X5 }
  76.     Question: { class: Question, onDelete: CASCADE, local: question_id, foreign: id, foreignAlias: Orders}
  77.     Answer: { class: QuestionAnswer, onDelete: CASCADE, local: answer_id, foreign: id, foreignAlias: Order}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement