You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

62 lines
4.0 KiB

  1. <?xml version="1.0"?>
  2. <!--
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. -->
  8. <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
  9. <table name="media_gallery_asset" resource="default" engine="innodb" comment="Media Gallery Asset">
  10. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="Entity ID"/>
  11. <column xsi:type="text" name="path" nullable="true" comment="Path"/>
  12. <column xsi:type="varchar" name="title" length="255" nullable="true" comment="Title"/>
  13. <column xsi:type="text" name="description" nullable="true" comment="Description"/>
  14. <column xsi:type="varchar" name="source" length="255" nullable="true" comment="Source"/>
  15. <column xsi:type="varchar" name="hash" length="255" nullable="true" comment="File hash"/>
  16. <column xsi:type="varchar" name="content_type" length="255" nullable="true" comment="Content Type"/>
  17. <column xsi:type="int" name="width" unsigned="true" nullable="false" identity="false" default="0" comment="Width"/>
  18. <column xsi:type="int" name="height" unsigned="true" nullable="false" identity="false" default="0" comment="Height"/>
  19. <column xsi:type="int" name="size" unsigned="true" nullable="false" identity="false" comment="Asset file size in bytes"/>
  20. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
  21. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP" comment="Updated At"/>
  22. <constraint xsi:type="primary" referenceId="PRIMARY">
  23. <column name="id"/>
  24. </constraint>
  25. <index referenceId="MEDIA_GALLERY_ID" indexType="btree">
  26. <column name="id"/>
  27. </index>
  28. <index referenceId="MEDIA_GALLERY_ASSET_TITLE" indexType="fulltext">
  29. <column name="title"/>
  30. </index>
  31. </table>
  32. <table name="media_gallery_keyword" resource="default" engine="innodb" comment="Media Gallery Keyword">
  33. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="Keyword ID"/>
  34. <column xsi:type="varchar" length="255" name="keyword" nullable="false" comment="Keyword"/>
  35. <constraint xsi:type="primary" referenceId="PRIMARY">
  36. <column name="id"/>
  37. </constraint>
  38. <index referenceId="MEDIA_GALLERY_KEYWORD" indexType="btree">
  39. <column name="id"/>
  40. </index>
  41. <constraint xsi:type="unique" referenceId="MEDIA_GALLERY_KEYWORD_KEYWORD_UNIQUE">
  42. <column name="keyword"/>
  43. </constraint>
  44. </table>
  45. <table name="media_gallery_asset_keyword" resource="default" engine="innodb" comment="Media Gallery Asset Keyword">
  46. <column xsi:type="int" name="keyword_id" unsigned="true" nullable="false" identity="false" comment="Keyword Id"/>
  47. <column xsi:type="int" name="asset_id" unsigned="true" nullable="false" identity="false" comment="Asset ID"/>
  48. <index referenceId="MEDIA_GALLERY_ASSET_KEYWORD_ASSET_ID_INDEX" indexType="btree">
  49. <column name="asset_id"/>
  50. </index>
  51. <index referenceId="MEDIA_GALLERY_ASSET_KEYWORD_KEYWORD_ID_INDEX" indexType="btree">
  52. <column name="keyword_id"/>
  53. </index>
  54. <constraint xsi:type="primary" referenceId="PRIMARY">
  55. <column name="keyword_id"/>
  56. <column name="asset_id"/>
  57. </constraint>
  58. <constraint xsi:type="foreign" referenceId="MEDIA_GALLERY_KEYWORD_KEYWORD_ID_MEDIA_GALLERY_KEYWORD_ID" table="media_gallery_asset_keyword" column="keyword_id" referenceTable="media_gallery_keyword" referenceColumn="id" onDelete="CASCADE"/>
  59. <constraint xsi:type="foreign" referenceId="MEDIA_GALLERY_KEYWORD_ASSET_ID_ASSET_ID" table="media_gallery_asset_keyword" column="asset_id" referenceTable="media_gallery_asset" referenceColumn="id" onDelete="CASCADE"/>
  60. </table>
  61. </schema>