From 3400fa8ff9c4b2b3d51f4f24bc8bc9c350ad1e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20B=C3=A9jean?= <nicolas@bejean.eu> Date: Sun, 3 May 2020 17:12:06 +0200 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20des=20tables=20dans=20la=20base?= =?UTF-8?q?=20de=20donn=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/db_schema.xml | 36 ++++++++++++++++++++++++++++++++++++ etc/db_schema_whitelist.json | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 etc/db_schema.xml create mode 100644 etc/db_schema_whitelist.json diff --git a/etc/db_schema.xml b/etc/db_schema.xml new file mode 100644 index 0000000..119d4c7 --- /dev/null +++ b/etc/db_schema.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> + <table name="nicolasbejean_categorywidget" resource="default" engine="innodb" comment="Category Widget Table"> + <column xsi:type="smallint" name="entity_id" padding="6" unsigned="false" nullable="false" identity="true" comment="Category Widget Entity ID"/> + <column xsi:type="varchar" name="title" nullable="false" length="255" comment="Category Widget Title"/> + <column xsi:type="varchar" name="identifier" nullable="false" length="255" comment="Category Widget String Identifier"/> + <column xsi:type="varchar" name="content" nullable="false" length="255" comment="Category Widget Content"/> + <column xsi:type="smallint" name="is_active" padding="6" unsigned="false" nullable="false" identity="false" default="1" comment="Is Category Widget Active"/> + <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP" comment="Category Widget Created At"/> + <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP" comment="Category Widget Updated At"/> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="entity_id"/> + </constraint> + <index referenceId="NICOLASBEJEAN_CATEGORYWIDGET_TITLE_IDENTIFIER_CONTENT" indexType="fulltext"> + <column name="title"/> + <column name="identifier"/> + <column name="content"/> + </index> + </table> + + <table name="nicolasbejean_categorywidget_store" resource="default" engine="innodb" comment="Category Widget To Store Linkage Table"> + <column xsi:type="smallint" name="entity_id" padding="6" unsigned="false" nullable="false" identity="false"/> + <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false" comment="Store ID"/> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="entity_id"/> + <column name="store_id"/> + </constraint> + <constraint xsi:type="foreign" referenceId="NICOLASBEJEAN_CATEGORYWIDGET_STORE_ENTITY_ID_NICOLASBEJEAN_CATEGORYWIDGET_ENTITY_ID" table="nicolasbejean_categorywidget_store" + column="entity_id" referenceTable="nicolasbejean_categorywidget" referenceColumn="entity_id" onDelete="CASCADE"/> + <constraint xsi:type="foreign" referenceId="NICOLASBEJEAN_CATEGORYWIDGET_STORE_STORE_ID_STORE_STORE_ID" table="nicolasbejean_categorywidget_store" + column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/> + <index referenceId="NICOLASBEJEAN_CATEGORYWIDGET_STORE_STORE_ID" indexType="btree"> + <column name="store_id"/> + </index> + </table> +</schema> diff --git a/etc/db_schema_whitelist.json b/etc/db_schema_whitelist.json new file mode 100644 index 0000000..28544d9 --- /dev/null +++ b/etc/db_schema_whitelist.json @@ -0,0 +1,33 @@ +{ + "nicolasbejean_categorywidget": { + "column": { + "entity_id": true, + "title": true, + "identifier": true, + "content": true, + "is_active": true, + "created_at": true, + "updated_at": true + }, + "index": { + "NICOLASBEJEAN_CATEGORYWIDGET_TITLE_IDENTIFIER_CONTENT": true + }, + "constraint": { + "PRIMARY": true + } + }, + "nicolasbejean_categorywidget_store": { + "column": { + "entity_id": true, + "store_id": true + }, + "index": { + "NICOLASBEJEAN_CATEGORYWIDGET_STORE_STORE_ID": true + }, + "constraint": { + "PRIMARY": true, + "FK_A74AA48FB295EA4DACE6FCBE3752A364": true, + "NICOLASBEJEAN_CATEGORYWIDGET_STORE_STORE_ID_STORE_STORE_ID": true + } + } +} \ No newline at end of file -- GitLab