-
Notifications
You must be signed in to change notification settings - Fork 10
/
db.changelog-1.xml
56 lines (56 loc) · 2.53 KB
/
db.changelog-1.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2019 Sven Loesekann Licensed under the Apache License, Version
2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License. -->
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet id="1" author="angular2guy">
<sql>CREATE EXTENSION if not exists hstore;</sql>
</changeSet>
<changeSet id="2" author="angular2guy">
<sql>CREATE EXTENSION if not exists vector;</sql>
</changeSet>
<changeSet id="3" author="angular2guy">
<sql>CREATE EXTENSION if not exists "uuid-ossp";</sql>
</changeSet>
<changeSet author="angular2guy" id="4">
<createTable tableName="document">
<column name="id" type="bigint">
<constraints primaryKey="true"/>
</column>
<column name="document_name" type="varchar(255)">
<constraints notNullConstraintName="document_document_name_notnull" nullable="false"/>
</column>
<column name="document_type" type="varchar(25)">
<constraints notNullConstraintName="document_document_type_notnull" nullable="false"/>
</column>
<column name="document_content" type="blob"/>
</createTable>
</changeSet>
<changeSet author="angular2guy" id="5">
<createSequence sequenceName="document_seq" incrementBy="50"
startValue="1000" />
</changeSet>
<changeSet id="6" author="angular2guy">
<createTable tableName="vector_store">
<column name="id" type="uuid" defaultValueComputed="uuid_generate_v4 ()">
<constraints primaryKey="true"/>
</column>
<column name="content" type="text"/>
<column name="metadata" type="json"/>
<column name="embedding" type="vector(1536)">
<constraints notNullConstraintName="vectorstore_embedding_type_notnull" nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet id="7" author="angular2guy">
<sql>CREATE INDEX vectorstore_embedding_index ON vector_store USING HNSW (embedding vector_cosine_ops);</sql>
</changeSet>
</databaseChangeLog>