1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <databaseChangeLog
3+ xmlns =" http://www.liquibase.org/xml/ns/dbchangelog"
4+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5+ xsi : schemaLocation =" http://www.liquibase.org/xml/ns/dbchangelog
6+ http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd" >
7+
8+ <changeSet id =" 1" author =" Zverev-DE" >
9+ <preConditions onFail =" MARK_RAN" >
10+ <not >
11+ <tableExists tableName =" users" />
12+ </not >
13+ </preConditions >
14+ <createTable tableName =" users" >
15+ <column name =" id" type =" BIGINT" autoIncrement =" true" >
16+ <constraints primaryKey =" true" nullable =" false" />
17+ </column >
18+ <column name =" chat_id" type =" BIGINT" >
19+ <constraints nullable =" true" />
20+ </column >
21+ <column name =" name" type =" VARCHAR(255)" >
22+ <constraints nullable =" true" />
23+ </column >
24+ </createTable >
25+ </changeSet >
26+
27+ <changeSet id =" 2" author =" Zverev-DE" >
28+ <preConditions onFail =" MARK_RAN" >
29+ <tableExists tableName =" users" />
30+ <not >
31+ <tableExists tableName =" note" />
32+ </not >
33+ </preConditions >
34+ <createTable tableName =" note" >
35+ <column name =" id" type =" BIGINT" autoIncrement =" true" >
36+ <constraints primaryKey =" true" nullable =" false" />
37+ </column >
38+ <column name =" users_id" type =" BIGINT" >
39+ <constraints nullable =" false" foreignKeyName =" fk_note_users" references =" users(id)" />
40+ </column >
41+ <column name =" content" type =" VARCHAR(255)" >
42+ <constraints nullable =" true" />
43+ </column >
44+ </createTable >
45+ </changeSet >
46+
47+ <changeSet id =" 3" author =" Zverev-DE" >
48+ <preConditions onFail =" MARK_RAN" >
49+ <not >
50+ <tableExists tableName =" chat_gpt_messages" />
51+ </not >
52+ </preConditions >
53+ <createTable tableName =" chat_gpt_messages" >
54+ <column name =" id" type =" BIGINT" autoIncrement =" true" >
55+ <constraints primaryKey =" true" nullable =" false" />
56+ </column >
57+ <column name =" question" type =" VARCHAR(5000)" >
58+ <constraints nullable =" true" />
59+ </column >
60+ <column name =" answer" type =" VARCHAR(5000)" >
61+ <constraints nullable =" true" />
62+ </column >
63+ <column name =" user_id" type =" BIGINT" >
64+ <constraints nullable =" true" />
65+ </column >
66+ </createTable >
67+ </changeSet >
68+
69+ </databaseChangeLog >
0 commit comments