blob: 223b541be725ca31496e259c20aec58d845998d3 [file] [log] [blame]
package spanner
// Generated by //go/sql/exporter/
// DO NOT EDIT
const Schema = `CREATE TABLE IF NOT EXISTS BlamedFiles (
id STRING(36) PRIMARY KEY,
file_path STRING(MAX) NOT NULL,
file_hash STRING(MAX) NOT NULL,
version STRING(MAX) NOT NULL,
commit_hash STRING(MAX) NOT NULL,
last_updated TIMESTAMP OPTIONS (allow_commit_timestamp=true)
);
CREATE TABLE IF NOT EXISTS LineBlames (
id STRING(36),
blamed_file STRING(MAX) NOT NULL,
line_number INT64 NOT NULL,
commit_hash STRING(MAX) NOT NULL
) PRIMARY KEY (id, line_number),
INTERLEAVE IN PARENT BlamedFiles ON DELETE CASCADE;
CREATE TABLE IF NOT EXISTS Topics (
topic_id INT64 PRIMARY KEY,
title STRING(1024) NOT NULL,
topic_group STRING(256),
summary STRING(MAX) NOT NULL,
code_context STRING(MAX) NOT NULL,
code_context_lines INT64 NOT NULL,
commit_count INT64
);
CREATE TABLE IF NOT EXISTS TopicChunks (
topic_id INT64,
chunk_id INT64,
chunk_index INT64 NOT NULL,
chunk_content STRING(MAX) NOT NULL,
embedding ARRAY<FLOAT32>(vector_length=>768) NOT NULL
) PRIMARY KEY (topic_id, chunk_id),
INTERLEAVE IN PARENT Topics ON DELETE CASCADE;
CREATE UNIQUE INDEX IF NOT EXISTS by_file_path on BlamedFiles (file_path);
CREATE VECTOR INDEX IF NOT EXISTS TopicChunksEmbeddingIndex on TopicChunks (embedding) OPTIONS (distance_type='COSINE');
`
var BlamedFiles = []string{
"id",
"file_path",
"file_hash",
"version",
"commit_hash",
"last_updated",
"UNIQUE",
}
var LineBlames = []string{
"id",
"blamed_file",
"line_number",
"commit_hash",
"INTERLEAVE",
}
var Topics = []string{
"topic_id",
"title",
"topic_group",
"summary",
"code_context",
"code_context_lines",
"commit_count",
}
var TopicChunks = []string{
"topic_id",
"chunk_id",
"chunk_index",
"chunk_content",
"embedding",
"INTERLEAVE",
"VECTOR",
}