-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmigrations.xml
More file actions
41 lines (39 loc) · 1.6 KB
/
migrations.xml
File metadata and controls
41 lines (39 loc) · 1.6 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<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.1.xsd">
<changeSet id="2" author="sc">
<preConditions onFail="CONTINUE">
<sqlCheck expectedResult="0">
select count(*) from user_sequences where sequence_name = 'SEQUENCE_NAME_SEQ';
</sqlCheck>
</preConditions>
<createSequence sequenceName="SEQUENCE_NAME_SEQ"/>
</changeSet>
<changeSet id="1" author="dmj">
<createTable tableName="Policy">
<column name="id" type="varchar(255)">
<constraints nullable="false"/>
</column>
<column name="tenant" type="varchar(255)">
<constraints nullable="false"/>
</column>
<column name="subject" type="varchar(255)">
<constraints nullable="false"/>
</column>
<column name="policy" type="MEDIUMTEXT"/>
</createTable>
<addPrimaryKey columnNames="tenant, id" tableName="Policy"/>
</changeSet>
<changeSet id="2" author="dmj">
<createIndex
indexName="idx_policy_by_tenant_subject"
tableName="Policy"
unique="false">
<column name="tenant" type="varchar(255)"/>
<column name="subject" type="varchar(255)"/>
</createIndex>
</changeSet>
</databaseChangeLog>