All Downloads are FREE. Search and download functionalities are using the official Maven repository.

installers.FileManagerModule.schema.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright 2014 the original author or authors
  ~
  ~ 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.1.xsd">

	<!-- Default table names -->
	<property name="table.file_reference" value="fmm_file_reference"/>
	<property name="table.file_reference_properties" value="fmm_file_ref_props"/>

	<include file="com/foreach/across/core/installers/AcrossSequencesInstaller.xml"/>

	<changeSet id="201803181747" author="stg" runAlways="true" dbms="oracle">
		<sql>
			ALTER session SET nls_length_semantics=CHAR;
		</sql>
	</changeSet>

	<!-- File Reference -->
	<changeSet id="201808201522" author="stg">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="${table.file_reference}"/>
			</not>
		</preConditions>

		<comment>Creates file reference table</comment>

		<createTable tableName="${table.file_reference}">
			<column name="id" type="java.sql.Types.BIGINT">
				<constraints nullable="false" primaryKey="true" primaryKeyName="pf_fmm_file_reference"/>
			</column>
			<column name="uuid" type="java.sql.Types.VARCHAR(255)">
				<constraints nullable="false"/>
			</column>
			<column name="name" type="java.sql.Types.NVARCHAR(255)">
				<constraints nullable="false"/>
			</column>
			<column name="file_descriptor" type="java.sql.Types.VARCHAR(255)">
				<constraints nullable="false"/>
			</column>
			<column name="file_size" type="java.sql.Types.BIGINT"/>
			<column name="mime_type" type="java.sql.Types.NVARCHAR(255)"/>
			<column name="hash" type="java.sql.Types.NVARCHAR(255)"/>
		</createTable>

		<createIndex tableName="${table.file_reference}" indexName="ix_fmm_file_ref_uuid" unique="true">
			<column name="uuid"/>
		</createIndex>
	</changeSet>

	<changeSet id="201808211525" author="stg">
		<comment>Add referential key between file ref properties and file ref table</comment>
		<addForeignKeyConstraint baseTableName="${table.file_reference_properties}"
		                         baseColumnNames="file_ref_id" constraintName="fk_fmm_frp_fr"
		                         referencedTableName="${table.file_reference}"
		                         referencedColumnNames="id"/>
	</changeSet>
</databaseChangeLog>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy