Newer
Older
gitbucket_jkp / src / main / resources / update / gitbucket-core_4.21.xml
@Naoki Takezoe Naoki Takezoe on 13 Jan 2018 2 KB Fix user interface of releases
<?xml version="1.0" encoding="UTF-8"?>
<changeSet>
  <createTable tableName="RELEASE">
    <column name="USER_NAME" type="varchar(100)" nullable="false"/>
    <column name="REPOSITORY_NAME" type="varchar(100)" nullable="false"/>
    <column name="RELEASE_ID" type="int" nullable="false" autoIncrement="true" unique="true"/>
    <column name="NAME" type="varchar(100)" nullable="false"/>
    <column name="TAG" type="varchar(100)" nullable="false"/>
    <column name="AUTHOR" type="varchar(100)" nullable="false"/>
    <column name="CONTENT" type="text" nullable="true"/>
    <column name="REGISTERED_DATE" type="datetime" nullable="false"/>
    <column name="UPDATED_DATE" type="datetime" nullable="false"/>
  </createTable>

  <addPrimaryKey constraintName="IDX_RELEASE_PK" tableName="RELEASE" columnNames="USER_NAME, REPOSITORY_NAME, RELEASE_ID"/>
  <addUniqueConstraint constraintName="IDX_RELEASE_UNIQ" tableName="RELEASE" columnNames="USER_NAME, REPOSITORY_NAME, TAG"/>
  <addForeignKeyConstraint constraintName="IDX_RELEASE_FK0" baseTableName="RELEASE" baseColumnNames="USER_NAME, REPOSITORY_NAME" referencedTableName="REPOSITORY" referencedColumnNames="USER_NAME, REPOSITORY_NAME"/>

  <createTable tableName="RELEASE_ASSET">
    <column name="USER_NAME" type="varchar(100)" nullable="false"/>
    <column name="REPOSITORY_NAME" type="varchar(100)" nullable="false"/>
    <column name="RELEASE_ID" type="int" nullable="false"/>
    <column name="RELEASE_ASSET_ID" type="int" nullable="false" autoIncrement="true" unique="true"/>
    <column name="FILE_NAME" type="varchar(260)" nullable="false"/>
    <column name="LABEL" type="varchar(100)" nullable="true"/>
    <column name="SIZE" type="bigint" nullable="false"/>
    <column name="UPLOADER" type="varchar(100)" nullable="false"/>
    <column name="REGISTERED_DATE" type="datetime" nullable="false"/>
    <column name="UPDATED_DATE" type="datetime" nullable="false"/>
  </createTable>
  <addPrimaryKey constraintName="IDX_RELEASE_ASSET_PK" tableName="RELEASE_ASSET" columnNames="USER_NAME, REPOSITORY_NAME, RELEASE_ID, FILE_NAME"
  />
  <addForeignKeyConstraint constraintName="IDX_RELEASE_ASSET_FK1" baseTableName="RELEASE_ASSET" baseColumnNames="USER_NAME, REPOSITORY_NAME, RELEASE_ID" referencedTableName="RELEASE" referencedColumnNames="USER_NAME, REPOSITORY_NAME, RELEASE_ID"/>
</changeSet>