<commit_before>package cache

import cache.models.{CachedPullRequest, CachedPullRequestPair}

import scala.slick.driver.SQLiteDriver.simple._
import scala.slick.lifted.ProvenShape._

object CacheSchema {
  object Tables {
    lazy val pairs = TableQuery[PairCache]
    lazy val pullRequests = TableQuery[PullRequestCache]
  }

  object TableNames {
    val pairs = "pair_cache"
    val pullRequests = "pr_cache"
  }

  object ColumnCount {
    val pairs = 3
    val pullRequests = 7
  }

  class PairCache(tag: Tag) extends Table[CachedPullRequestPair](tag, TableNames.pairs) {
    def shaOne = column[String]("sha_one")
    def shaTwo = column[String]("sha_two")
    def isMergeable = column[Boolean]("is_mergeable")

    def * = (shaOne, shaTwo, isMergeable) <> (CachedPullRequestPair.tupled, CachedPullRequestPair.unapply)

    def pk = primaryKey("sha", (shaOne, shaTwo))
  }

  class PullRequestCache(tag: Tag) extends Table[CachedPullRequest](tag, TableNames.pullRequests) {
    def sha = column[String]("sha", O.PrimaryKey)
    def isMergeable = column[Boolean]("is_mergeable")
    def linesAdded = column[Long]("lines_added")
    def linesDeleted = column[Long]("lines_deleted")
    def filesChanged = column[Long]("files_changed")
    def commits = column[Long]("commits")
    def hasTestCode = column[Boolean]("has_test_code")

    def * = (sha, isMergeable, linesAdded, linesDeleted, filesChanged, commits, hasTestCode) <> (CachedPullRequest.tupled, CachedPullRequest.unapply)
  }
}<commit_msg>Set max length on sha db field<commit_after>package cache

import cache.models.{CachedPullRequest, CachedPullRequestPair}

import scala.slick.driver.SQLiteDriver.simple._
import scala.slick.lifted.ProvenShape._

object CacheSchema {
  object Tables {
    lazy val pairs = TableQuery[PairCache]
    lazy val pullRequests = TableQuery[PullRequestCache]
  }

  object TableNames {
    val pairs = "pair_cache"
    val pullRequests = "pr_cache"
  }

  object ColumnCount {
    val pairs = 3
    val pullRequests = 7
  }

  class PairCache(tag: Tag) extends Table[CachedPullRequestPair](tag, TableNames.pairs) {
    def shaOne = column[String]("sha_one", O.Length(40, varying = false))
    def shaTwo = column[String]("sha_two", O.Length(40, varying = false))
    def isMergeable = column[Boolean]("is_mergeable")

    def * = (shaOne, shaTwo, isMergeable) <> (CachedPullRequestPair.tupled, CachedPullRequestPair.unapply)

    def pk = primaryKey("sha", (shaOne, shaTwo))
  }

  class PullRequestCache(tag: Tag) extends Table[CachedPullRequest](tag, TableNames.pullRequests) {
    def sha = column[String]("sha", O.PrimaryKey, O.Length(40, varying = false))
    def isMergeable = column[Boolean]("is_mergeable")
    def linesAdded = column[Long]("lines_added")
    def linesDeleted = column[Long]("lines_deleted")
    def filesChanged = column[Long]("files_changed")
    def commits = column[Long]("commits")
    def hasTestCode = column[Boolean]("has_test_code")

    def * = (sha, isMergeable, linesAdded, linesDeleted, filesChanged, commits, hasTestCode) <> (CachedPullRequest.tupled, CachedPullRequest.unapply)
  }
}
{'fraction_non_alphanumeric': 0.11602564102564103, 'fraction_numerical': 0.003205128205128205, 'mean_word_length': 4.779629629629629, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5511357', 'n_tokens_mistral': 1036, 'n_tokens_neox': 999, 'n_words': 217}