@@ -4,7 +4,7 @@ CREATE DATABASE lor_e;
44
55CREATE EXTENSION vector;
66
7- CREATE TABLE IF NOT EXISTS issues (
7+ CREATE TABLE issues (
88 id SERIAL PRIMARY KEY ,
99 source_id VARCHAR NOT NULL UNIQUE,
1010 source VARCHAR NOT NULL ,
@@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS issues (
2020 updated_at timestamp with time zone NOT NULL DEFAULT (current_timestamp AT TIME ZONE ' UTC' )
2121);
2222
23- CREATE TABLE IF NOT EXISTS comments (
23+ CREATE TABLE comments (
2424 id SERIAL PRIMARY KEY ,
2525 source_id VARCHAR NOT NULL UNIQUE,
2626 issue_id INT NOT NULL REFERENCES issues(id) ON DELETE CASCADE ,
@@ -30,13 +30,13 @@ CREATE TABLE IF NOT EXISTS comments (
3030 updated_at timestamp with time zone NOT NULL DEFAULT (current_timestamp AT TIME ZONE ' UTC' )
3131);
3232
33- CREATE INDEX IF NOT EXISTS issues_source_id_idx ON issues (source_id);
34- CREATE INDEX IF NOT EXISTS comments_source_id_idx ON comments (source_id);
35- CREATE INDEX IF NOT EXISTS issues_embedding_hnsw_idx ON issues USING hnsw (embedding halfvec_cosine_ops);
33+ CREATE INDEX issues_source_id_idx ON issues (source_id);
34+ CREATE INDEX comments_source_id_idx ON comments (source_id);
35+ CREATE INDEX issues_embedding_hnsw_idx ON issues USING hnsw (embedding halfvec_cosine_ops);
3636
3737CREATE TYPE job_type AS ENUM (' embeddings_regeneration' , ' issue_indexation' );
3838
39- CREATE TABLE IF NOT EXISTS jobs (
39+ CREATE TABLE jobs (
4040 id SERIAL PRIMARY KEY ,
4141 job_type job_type NOT NULL ,
4242 repository_full_name VARCHAR UNIQUE,
@@ -45,5 +45,5 @@ CREATE TABLE IF NOT EXISTS jobs (
4545 updated_at timestamp with time zone NOT NULL DEFAULT (current_timestamp AT TIME ZONE ' UTC' )
4646);
4747
48- CREATE INDEX IF NOT EXISTS jobs_repository_id_idx ON jobs (repository_id);
49- CREATE UNIQUE INDEX IF NOT EXISTS jobs_type_embeddings_regeneration_idx ON jobs (job_type) WHERE job_type = ' embeddings_regeneration' ;
48+ CREATE INDEX jobs_repository_id_idx ON jobs (repository_id);
49+ CREATE UNIQUE INDEX jobs_type_embeddings_regeneration_idx ON jobs (job_type) WHERE job_type = ' embeddings_regeneration' ;
0 commit comments