<Databases>
  <Database>
    <Tables>
	  <Table Name="T_STORAGE_ROOM" Schema="STOR">
        <Columns>
          <Column Name="StorageRoomID" Type="guid" IsNullable="0" />
          <Column Name="Number" Type="int" IsNullable="0" />
          <Column Name="Name" Type="string" Length="255" IsNullable="1" />
		  <Column Name="Specification" Type="string" Length="512" IsNullable="1" />
          <Column Name="Storage" Type="guid" IsNullable="0" />
        </Columns>
        <PrimaryKey Name="PK_T_STORAGE_ROOM" Clustered="1">
          <Column Name="StorageRoomID" />
        </PrimaryKey>
        <ForeignKeys>
          <ForeignKey Name="FK_T_STORAGE_T_STORAGE_ROOM_Storage" Column="Storage" Table="T_STORAGE" TableSchema="STOR" TableColumn="StorageID" CascadeDelete="0" CascadeUpdate="0" />
        </ForeignKeys>
      </Table>
	  <Table Name="T_STORAGE_RACK" Schema="STOR">
        <Columns>
          <Column Name="StorageRackID" Type="guid" IsNullable="0" />
          <Column Name="Number" Type="int" IsNullable="0" />
          <Column Name="Name" Type="string" Length="255" IsNullable="1" />
		  <Column Name="Specification" Type="string" Length="512" IsNullable="1" />          
          <Column Name="StorageRoom" Type="guid" IsNullable="0" />
        </Columns>
        <PrimaryKey Name="PK_T_STORAGE_RACK" Clustered="1">
          <Column Name="StorageRackID" />
        </PrimaryKey>
        <ForeignKeys>
          <ForeignKey Name="FK_T_STORAGE_ROOM_T_STORAGE_RACK_StorageRoom" Column="StorageRoom" Table="T_STORAGE_ROOM" TableSchema="STOR" TableColumn="StorageRoomID" CascadeDelete="0" CascadeUpdate="0" />
        </ForeignKeys>
      </Table>
	  <Table Name="T_STORAGE_SHELF" Schema="STOR">
        <Columns>
          <Column Name="StorageShelfID" Type="guid" IsNullable="0" />
          <Column Name="Number" Type="int" IsNullable="0" />
          <Column Name="Name" Type="string" Length="255" IsNullable="1" />
		  <Column Name="Specification" Type="string" Length="512" IsNullable="1" />
		  <Column Name="StorageRack" Type="guid" IsNullable="0" />
        </Columns>
        <PrimaryKey Name="PK_T_STORAGE_SHELF" Clustered="1">
          <Column Name="StorageShelfID" />
        </PrimaryKey>
        <ForeignKeys>
          <ForeignKey Name="FK_T_STORAGE_RACK_T_STORAGE_SHELF_StorageRack" Column="StorageRack" Table="T_STORAGE_RACK" TableSchema="STOR" TableColumn="StorageRackID" CascadeDelete="0" CascadeUpdate="0" />
        </ForeignKeys>
      </Table>
	  <Table Name="T_REMAINS" Schema="STOR">
        <AddColumns>
          <Column Name="StorageShelf" Type="guid" IsNullable="1" />
        </AddColumns>
        <ForeignKeys>
          <ForeignKey Name="FK_T_STORAGE_SHELF_T_REMAINS_StorageShelf" Column="StorageShelf" Table="T_STORAGE_SHELF" TableSchema="STOR" TableColumn="StorageShelfID" CascadeDelete="0" CascadeUpdate="0" />
        </ForeignKeys>
      </Table>
	  <Table Name="T_INVOICE_ITEM" Schema="STOR">
        <AddColumns>
          <Column Name="StorageShelf" Type="guid" IsNullable="1" />
        </AddColumns>
        <ForeignKeys>
          <ForeignKey Name="FK_T_STORAGE_SHELF_T_INVOICE_ITEM_StorageShelf" Column="StorageShelf" Table="T_STORAGE_SHELF" TableSchema="STOR" TableColumn="StorageShelfID" CascadeDelete="0" CascadeUpdate="0" />
        </ForeignKeys>
      </Table>
    </Tables>
  </Database>
</Databases>