<commit_before>import {r, type} from 'src/server/util/thinky'

const {string, date, array, object} = type

export default {
  name: 'Project',
  table: 'projects',
  schema: {
    id: string()
      .uuid(4)
      .allowNull(false),

    chapterId: string()
      .uuid(4)
      .allowNull(false),

    cycleId: string()
      .uuid(4)
      .allowNull(false),

    name: string()
      .min(1)
      .allowNull(false),

    goal: object()
      .allowNull(false)
      .allowExtra(true),

    playerIds: array()
      .allowNull(false),

    projectReviewSurveyId: string()
      .uuid(4)
      .allowNull(false),

    retrospectiveSurveyId: string()
      .uuid(4)
      .allowNull(false),

    createdAt: date()
      .allowNull(false)
      .default(r.now()),

    updatedAt: date()
      .allowNull(false)
      .default(r.now()),
  },
  associate: (Project, models) => {
    Project.belongsTo(models.Chapter, 'chapter', 'chapterId', 'id', {init: false})
    Project.belongsTo(models.Cycle, 'cycle', 'cycleId', 'id', {init: false})
    Project.belongsTo(models.Survey, 'projectReviewSurvey', 'projectReviewSurveyId', 'id', {init: false})
    Project.belongsTo(models.Survey, 'retrospectiveSurvey', 'retrospectiveSurveyId', 'id', {init: false})
  },
}
<commit_msg>remove required contstraint for project survey ids<commit_after>import {r, type} from 'src/server/util/thinky'

const {string, date, array, object} = type

export default {
  name: 'Project',
  table: 'projects',
  schema: {
    id: string()
      .uuid(4)
      .allowNull(false),

    chapterId: string()
      .uuid(4)
      .allowNull(false),

    cycleId: string()
      .uuid(4)
      .allowNull(false),

    name: string()
      .min(1)
      .allowNull(false),

    goal: object()
      .allowNull(false)
      .allowExtra(true),

    playerIds: array()
      .allowNull(false),

    projectReviewSurveyId: string()
      .uuid(4),

    retrospectiveSurveyId: string()
      .uuid(4),

    createdAt: date()
      .allowNull(false)
      .default(r.now()),

    updatedAt: date()
      .allowNull(false)
      .default(r.now()),
  },
  associate: (Project, models) => {
    Project.belongsTo(models.Chapter, 'chapter', 'chapterId', 'id', {init: false})
    Project.belongsTo(models.Cycle, 'cycle', 'cycleId', 'id', {init: false})
    Project.belongsTo(models.Survey, 'projectReviewSurvey', 'projectReviewSurveyId', 'id', {init: false})
    Project.belongsTo(models.Survey, 'retrospectiveSurvey', 'retrospectiveSurveyId', 'id', {init: false})
  },
}

{'fraction_non_alphanumeric': 0.16475247524752476, 'fraction_numerical': 0.004752475247524752, 'mean_word_length': 3.0416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6531672', 'n_tokens_mistral': 876, 'n_tokens_neox': 848, 'n_words': 172}